Token verification failed. Please go back and try again.

Started by barry1947, June 02, 2024, 09:28:47 AM

Previous topic - Next topic

barry1947

Hi Team,
I am getting quite a few of these errors in logging in. Both me and my forum partner who is also admin are getting them. We try several times and then without changing anything it lets us in. We have one chap that we have to remove his membership each time so that he can create a new one and log in. I am using www in my url but I have an entry in my .htaccess in the root of the site that seems to be working fine.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
Any help to cure this will be much appreciated.
Many thanks once again,
Barry.

PS This error does not seem to get into the error log so I am unaware of how many times this is happening.

brynn

I cannot address anything about your htaccess file, since it's a bit too technical for me. Maybe someone else can? But I have seen that error from time to time.

I have searched the forum in the past, and found it has been reported quite a few times over the years. There are different proposed reasons for it and solutions for it. To be honest, I did not understand everything.

But here's what works for me, almost always. Every time it happens, I have become logged out (either on purpose or by accident) while having multiple browser tabs, addressed to my forum, open at the same time. Sometimes all I need to do is close all the tabs (that are addressed either to my forum, or any SMF forum) except for one, and then I can log in again. Other times, just closing the multiple tabs is not enough, and I need to restart my browser, and open it again with only one tab (that's addressed to my forum). And then I can log in.

Edit
As a last resort, the same routine of closing all tabs but one, then restart the computer.

Generally, I try to make sure to check the Forever box when I log in. That way I can avoid the problem for long stretches.

barry1947

Hi There Brynn,
Now that sounds like a Good Welsh Name to me. I live in South Wales.
Many thanks for your information on what you have found. It is something that I had not considered. I had a Moderator could not log in today because of it.
I have changed the login default to Forever so that will help and I will tell people not to log out. I have no idea of how many times this is happening because it does not go into the Error log. Do you know if there is a way to make that happen?.
Anyhow your comments are really very welcome. My thanks to you once again.
I will put an Admin post up based on what you have said.
Have a wonderful day and the very best regards from me.
Barry.

brynn

Hi Barry,
Welsh? I did not know that! Until I found the internet (in my 40s) I did not know it was a traditional name. I thought it was something my parents invented! There must be something to it though, because I could pass for Welsh (red hair, blue eyes, etc.). I keep thinking I should research my genealogy someday  ::)

Re the token error. Admittedly, I struggle with technical language and issues. But this is my simple ("dumbed down") understanding.
To my understanding, the "token" is either all or part of the code which is delivered by the cookie which SMF sends everyone. (The last paragraph of the SMF Registration Agreement gives a simple explanation about the cookie.)

I still don't know exactly what goes wrong. But my theory is that by keeping multiple tabs open, over time I might end up with one tab that was opened during one login, and another tab that was opened during a different login. So when I try to login in, there is some kind of conflict with the cookie/tokens that came from the pre-existing logins on the other tabs.

I don't know if that is even remotely close to what actually happens. But that's how I think of it, anyway. And closing all my SMF tabs seems to work. You should really search the forum, because there is a lot of info about it. I cannot understand most of it, but from your original message, it sounds like you might be able to understand it.

I have no idea why it does not generate an error in SMF. I could give you more of my simple-minded thoughts and theories. But it would be better to wait for someone who is more knowledgeable about the SMF code(s). Who knows - maybe there is some way to generate those errors in SMF with a simple tweak?? Unfortunately, working with the code is mostly over my head. For all I know, it might require a lot of hacking?

Good luck!

Aleksi "Lex" Kilpinen

You probably should not rewrite, but instead redirect. Edit: I was being stupid, you are redirecting - that's what the 301 is. Sorry.
Run repair_settings, make sure all your urls and paths are uniform, and align with the address you are redirecting to.
If one url is https verything should be https, if one url is www everything should be www.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

barry1947

Hi Brynn,
Many thanks for your reply and further insights as well.
As for being Welsh, if you can sing you probably have Welsh somewhere in your background.

I am sort of half okay with the Techie stuff because I was a C programmer for a large number of years on several OS'. But as years go on, you do not take the courses and things change.

I can see the logic in what you have suggested despite finding it strange from a programming perspective, and I did traverse the earlier topics but I gleaned little from them. Your message to me as a user who has found something that works makes a lot more sense.

I have put an Admin message up this morning highlighting what you suggested and I shall see where that takes us.

With the cookie connection I have tried clearing them when the problem occurs but it does not seem to help or the members did not clear them properly.
My thanks to you once again Brynn. You have been very helpful and it has been a pleasure communicating with you.
Best regards,
Barry.

barry1947

Hi Lex,
Many thanks for your comment as well.
I have already done that but it may be worth checking again so I will do that when I exit the Forum here. You never know, something could dislodge them.
Once again my thanks to you.
Best regards,
Barry.

Advertisement: