Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: GigaWatt on February 26, 2018, 06:35:15 PM

Title: Re: Session verification failed. Please try logging out and back in again
Post by: GigaWatt on February 26, 2018, 06:35:15 PM
I don't mean to revive old threads, but I had the exact same problem with my forum yesterday. "Session verification failed. Please try logging out and back in again, and then try again." and there were no entries in the error log. I just wanted to point out the circumstances under which SMF threw this error.

I was messing around with index.php, proxy.php... basically, all of the script files in the root. I was trying to make the line endings Windows compatible (CR + LF) and also saved them as UTF-8 instead of ANSI. I didn't thought SMF would mind this (most servers recognize UTF-8 and CR + LF line end/new line), but I was wrong. After I saved them and copied them via FTP (binary mode, not ASCII), while I was logged in, I logged out and couldn't log in afterwards. SMF threw the previously mentioned error.

I just downloaded a fresh copy of the adequate SMF version I had on my forum (in my case 2.0.15) copied all of the files I altered and voila :), everything was working fine ;).

I was just wondering if someone could give an explanation why this happened ???. I thought the script formatting wouldn't matter (most servers are Debian based, CR + LF and UTF-8 in text files was implemented a while ago), so I really couldn't find an explanation to why this happened. Maybe this particular server threw this error (I'm on 1and1, I know, I have to switch to another hosting service ;D) ???. Maybe the fact that I was logged in and logged out after I altered the files was the trigger to this behavior? Maybe the script makes a binary check (CRC) of some it's files during log in and out just to make sure nobody tempered with them?

Any insight on the issue would be appreciated ;).

Just to be clear, I've solved the problem so I don't need help solving it, I'm just curious ;).
Title: Re: Session verification failed. Please try logging out and back in again
Post by: shnazzle on February 28, 2018, 07:33:25 AM
Not sure if it's related at all but I'm getting rather sick of the session errors.
Either this one posted, or "session expired" or "session timed out" or one of the many others.

Basically the damn thing doesn't seem to be able to hold a session. And if you're like me and log in via multiple devices, you're extra screwed.

I've cleared my web cache, I've cleared the server cache, I'm running 2.0.15 so the necessary code around not reading "," and "-" is in there, I'm running PHP 5.6, so all should be fine.
I've tried almost every code fix I can find on these forums and if anything it's just getting worse. To the point now where I had to just switch to my PC because my phone will no longer do anything on the forum without a session error. Even after a cache clear, shut down, etc.

Title: Re: Session verification failed. Please try logging out and back in again
Post by: GigaWatt on February 28, 2018, 04:18:06 PM
What's in you error log?
Title: Re: Re: Session verification failed. Please try logging out and back in again
Post by: Doug Heffernan on February 28, 2018, 04:32:12 PM
Can you post a screenshot of your Cookies and Sessions page?


Title: Re: Re: Session verification failed. Please try logging out and back in again
Post by: GigaWatt on February 28, 2018, 09:27:48 PM
Sure.

(http://www.mediafire.com/convkey/03bd/4ccbpevs6maqyv9zg.jpg)
Title: Re: Re: Session verification failed. Please try logging out and back in again
Post by: Illori on March 01, 2018, 05:13:36 AM
try installing https://custom.simplemachines.org/mods/index.php?mod=4167 and see if it helps your issue.
Title: Re: Re: Session verification failed. Please try logging out and back in again
Post by: Doug Heffernan on March 01, 2018, 05:15:24 AM
Can you uncheck the Enable local storage of cookies setting and see if it would help?

Another thing, the cookie name, does it match that of $cookiename var in your Settings.php file?
Title: Re: Re: Session verification failed. Please try logging out and back in again
Post by: Illori on March 01, 2018, 05:38:13 AM
well it has to match that value as that is where it gets it from...
Title: Re: Re: Session verification failed. Please try logging out and back in again
Post by: GigaWatt on March 01, 2018, 07:23:46 PM
Can you uncheck the Enable local storage of cookies setting and see if it would help?

Another thing, the cookie name, does it match that of $cookiename var in your Settings.php file?

Actually... I'm not the one having the problem anymore. If you read the first post in the thread, I just had a question that I hoped someone could answer. shnazzle was the one who still has a problem with his/hers forum... and I had no idea if doug_ips was addresing me or shnazzle in his post, so... I just posted a screen shot :D.

And yes, the cookie name in Settings.php and Settings_bak.php matches the one in the set in Cookies and Sessions. I think this is must, since, I think SMF reads this string from Settings.php. Actually, I had no idea where to set the cookie name, so I poked around in Settings.php and found the cookie name section, changed it in Settings.php and Settings_bak.php and afterwards found the Cookies and Sessions section ;D.
Title: Re: Re: Session verification failed. Please try logging out and back in again
Post by: Aleksi "Lex" Kilpinen on March 08, 2018, 12:45:52 AM
Just to keep things tidy then, I'll mark this topic solved. If shnazzle is still having those issues, I'd advice them to open their own topic.
Title: Re: Session verification failed. Please try logging out and back in again
Post by: shnazzle on February 22, 2020, 09:55:09 AM
Just noticed this. Apologies for the very late reply.
But for those on 2.0.15,which I'm guessing is still a fair few, I haven't had this issue since upgrading to 2.1 RC2. I never did get to the bottom of the issue, I tried all sorts. But going to 2.1 has been great so whatever has been implemented in there fixed this.