Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Black Tiger on December 06, 2017, 06:14:51 PM

Title: Session timeout on small login.
Post by: Black Tiger on December 06, 2017, 06:14:51 PM
On one of the forums, when trying to login, we get this error instantly:
QuoteFout bij het versturen van het formulier. Sessie timeout.
Which is translated something like "Error when sending the form. Session timeout".

This is odd, because when I look at the apache logs, it just gives a http 200 which means all is ok, like this:
84.xx.xx.xx - - [07/Dec/2017:00:02:26 +0100] "POST /forum/index.php?action=login2 HTTP/1.1" 200 2989 "http://www.hobbyforum.org/forum/index.php?action=login2" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0"

However, when we click the other login option in the bar where also the "help" and "New Posts" "Register" etc. is resided, then logging in doesn't give any problems.

I've seen this before, but I don't remember the cause of it.

SMF 2.0.15 with updated language packs. :)
Apache/2.2.31
Php 5.5.34 :( yeah I know, new server is being configured right now. Owner was lazy.
mysql 5.5.52

Installed mods:
1. Child Board Removal 1.0
2. My Posts SMF2 1.2
3. Redirection Topics 1.0.3
4. Remove "Last edit" mod 0.2.5
5. Like Posts 2.0.2
6. SMF 2.0.15 Update 1.0
7. Project Snow 1.2 1.2
8. Birthday On Register 1.0
9. Contact Page 3.2


How can it be fixed so the smaller login option can be used too again?
Title: Re: Session timeout on small login.
Post by: Arantor on December 06, 2017, 06:47:01 PM
Link?
Title: Re: Session timeout on small login.
Post by: Black Tiger on December 06, 2017, 06:51:35 PM
That's duckfiles.org.
Title: Re: Session timeout on small login.
Post by: Sir Osis of Liver on December 06, 2017, 10:02:01 PM
Check for this in your theme's index.template.php -



<input type="hidden" name="hash_passwrd" value="" />
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />



You need both lines or you'll get session timeouts.

Title: Re: Session timeout on small login.
Post by: Raths Rants on December 07, 2017, 02:13:38 AM
Thanks! I was having the same issue. Fixed like a charm  ;D

Quote from: Sir Osis of Liver on December 06, 2017, 10:02:01 PM
Check for this in your theme's index.template.php -



<input type="hidden" name="hash_passwrd" value="" />
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />



You need both lines or you'll get session timeouts.
Title: Re: Session timeout on small login.
Post by: Black Tiger on December 07, 2017, 08:55:38 AM
Hmmz... I don't know who marked this topic solved, but I should have been the one, since I started the thread and it could have been something else, one never knows. :D
But no harm done.

@Sir Osis of Liver: Thank you very much, the second line was missing, fixed now! ;)
Title: Re: Session timeout on small login.
Post by: Illori on December 07, 2017, 08:57:10 AM
Quote from: Black Tiger on December 07, 2017, 08:55:38 AM
Hmmz... I don't know who marked this topic solved, but I should have been the one, since I started the thread and it could have been something else, one never knows. :D
But no harm done.
it gets confusing when someone else comes into the topic and says this solved the issue. sorry it got marked solved ahead of time.
Title: Re: Session timeout on small login.
Post by: Black Tiger on December 07, 2017, 09:12:44 AM
It can get confusing indeed. But as stated, no harm done in this case. ;) It was quite a clear solution and I'm glad somebody else is helped too with it.
Title: Re: Session timeout on small login.
Post by: Kindred on December 07, 2017, 06:34:20 PM
incidentally, there is an FAQ on this specific issue... :P
Title: Re: Session timeout on small login.
Post by: Black Tiger on December 07, 2017, 06:51:08 PM
Interesting. Pity you forgot to link to it. :D
Title: Re: Session timeout on small login.
Post by: Kindred on December 07, 2017, 08:42:25 PM
Or maybe I expected someone to be able to click a few links and get there himself?
Title: Re: Session timeout on small login.
Post by: Black Tiger on December 07, 2017, 09:10:13 PM
Maybe that someone already checked the wiki and some faq's and did not find anything? Except for that one is supposed to mark thread solved if it's solved?
I searched for the word "solved", and since I did nothing wrong, a bit of service by pointing to it would be welcome.;)
Who says A also should say B or say nothing at all is a common way of saying in our contry. 8)
Title: Re: Session timeout on small login.
Post by: Kindred on December 07, 2017, 09:43:54 PM
https://wiki.simplemachines.org/smf/Login_error_2.0.14

I have no idea what your last post even meant...  but as I am often working from a phone, posting links can be a pain
Title: Re: Session timeout on small login.
Post by: Arantor on December 08, 2017, 02:36:50 AM
Except this is a 2.0.15 forum, it's not obvious that the problem could continue to occur.

I should write a patch that fixes it in all custom themes sometime, it's possible to do.
Title: Re: Session timeout on small login.
Post by: Black Tiger on December 08, 2017, 07:01:58 AM
@Arantor: That would be nice.

@Kindred: Oh from the phone, that makes life a lot more difficult indeed. Didn't know that you were most using the phone.
However, since your reply was stated at a late point after the topic was already marked solved, I thought you were referring with your reply to the "mark topic solved" comments in the thread, so it was not clear to me you were referring to the login issue.
I searched for "session timeout" which is the error notice, not for "login error" as it was possible to login via the other login option, so that's why I couldn't find it in the faq.
Title: Re: Session timeout on small login.
Post by: Kindred on December 08, 2017, 11:34:09 AM
Good point, updated the faq entry
Title: Re: Session timeout on small login.
Post by: Black Tiger on December 08, 2017, 11:44:51 AM
Great, good job!
Title: Re: Session timeout on small login.
Post by: Sir Osis of Liver on December 08, 2017, 12:04:04 PM
Quote from: Arantor on December 08, 2017, 02:36:50 AM
Except this is a 2.0.15 forum, it's not obvious that the problem could continue to occur.

I updated my two production forums, and a client forum, from 2.0.13 -> .14 -> .15, session check was added correctly to login on all three.

Title: Re: Session timeout on small login.
Post by: Arantor on December 08, 2017, 12:11:35 PM
It sometimes will be, but there's plenty of places where it won't for whatever reason - and an FAQ page called "login error 2.0.14" isn't obviously relevant to 2.0.15.

I find it interesting that a single fix of maybe two dozen lines of code could fix every theme and plugin including things like portals. But playing with the output buffer isn't for the faint of heart.