Users can´t log in

Hi,

I have many users (level 1) who can´t log in with correct username and password. They have to change their password over and over again. First, the link they receive is not valid. So they have to make the site send them another link to reset the password. It often takes 3-5 times until they´re able to reset the password and log in. In a few days, the story is the same - they can´t enter with the new password and have to reset it again.

Any idea why this is happening? It´s very annoying to receive their complaints and I don´t know how to help

Who is your host? It sounds to me as though they have Varnish running on your site. If so, you need to get them to disable it completely.

If it’s not Varnish, it is almost certainly some other sort of caching issue.

1 Like

Hi,

I use Siteground. I disabled dynamic cache that is based on Varnish to see if it helps. If it´s not Varnish, how can I detect what exactly creates the problem?

I Deactivated cache, deactivated wordfence that often creates this sort of problem, still some users cant log in with valis password. My host checked the site and the only errors it found was related to s2member:

[20-Feb-2017 20:20:28 UTC] PHP Fatal error: s2If, AND/OR malformed conditional logic. It’s NOT possible to mix logic using AND/OR combinations. You MUST stick to one type of logic or another. If both types of logic are needed, you MUST use two different Shortcode expressions. Or, use Advanced (PHP) Conditionals instead. in /home/newsinsl/public_html/wp-content/plugins/s2member/src/includes/classes/sc-if-conds-in.inc.php on line 132

Here is my typical post, can you see an error? (both conditions inside one blog post)

[s2If !is_user_logged_in() OR current_user_is(s2member_level0)]

text visible for level 0 only

[s2Member-Login /][/s2If]

[s2If current_user_is(s2member_level1) OR current_user_is(administrator)]

text visible for administrator and level 1

[/s2If]

Do you think this error creates login problems? if so, how to fix it? Please, help! I´m desperate to solve it asap

I don’t know if that’s what’s causing the problem, but you can simplify your code considerably, like this:

[s2If current_user_can(access_s2member_level1)]
    Some content for Members who are logged in with an s2Member Level >= 1.
[/s2If]

[s2If !current_user_can(access_s2member_level1)]
    Some other content.
[/s2If]

Hi Tim,

Thanks for the reply. But that´s a minor thing. The big problem is that s2member is not working properly on my site and I can´t figure out why. Any input on how to solve the login problem that I described in the first message? If it´s not cache problem, what can it be?

Have you tried the simplified code? We need to take it in stages, so let’s rule that out as the problem first.

I have 200+ posts with the code I wrote above. It would be a nightmare to change them all just to see if that was the thing. I maybe use a more complicated version but from the logic point of view it´s correct, and there is no or / and problem that was n logs. I found one post where I forgot to add “]” in the shortcut, so it returned exactly this:

[20-Feb-2017 20:20:28 UTC] PHP Fatal error: s2If, AND/OR malformed conditional logic. It’s NOT possible to mix logic using AND/OR combinations. You MUST stick to one type of logic or another. If both types of logic are needed, you MUST use two different Shortcode expressions. Or, use Advanced (PHP) Conditionals instead. in /home/newsinsl/public_html/wp-content/plugins/s2member/src/includes/classes/sc-if-conds-in.inc.php on line 132

I think that somebody tried to access that post, that is why there was this problem in the log. But I just can´t see what it had to do with login form. Conditions work fine, the only problem I have is that some users can´t log in with correct password.

The next thing I’d try would be to look at your Cloudfront settings. You don’t want any caching being done on a login page.