Advertisement:

Author Topic: Login Error  (Read 877 times)

Offline Saftek

  • Semi-Newbie
  • *
  • Posts: 21
Login Error
« on: May 29, 2017, 03:56:17 PM »
SMF 2.0.14

After updating to 2.0.14

Getting: Your session timed out while posting. Please go back and try again. error with the login block at the top of any theme.

If I use the "login" link in the login or register line, or the login at the nav bar it works?

Any ideas why this might be happening?

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,200
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Login Error
« Reply #1 on: May 29, 2017, 04:06:18 PM »
If your custom theme has a login form such as in the index.template.php or boardindex.template.php or in the login.template.php

The SMF 2.0.14 now requires the following code added in the <form> tag  just add in the closing </form> tag in any login form.

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

This code is used to help increase security for SMF.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Saftek

  • Semi-Newbie
  • *
  • Posts: 21
Re: Login Error
« Reply #2 on: May 29, 2017, 04:08:00 PM »
This happens with every theme... will check code in them.

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,200
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Login Error
« Reply #3 on: May 29, 2017, 04:09:25 PM »
Yes it will occur on any custom themes.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Saftek

  • Semi-Newbie
  • *
  • Posts: 21
Re: Login Error
« Reply #4 on: May 29, 2017, 05:20:49 PM »
Apparently, that fixed the problem. Thanks.

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,200
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Login Error
« Reply #5 on: May 29, 2017, 05:40:48 PM »
Glad to help.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,200
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Login Error
« Reply #6 on: May 31, 2017, 08:12:49 PM »
No idea might have failed update for some unknown reason.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Gwenwyfar

  • Full Member
  • ***
  • Posts: 507
  • Gender: Female
    • Gwenwyfar on GitHub
Re: Login Error
« Reply #7 on: May 31, 2017, 08:16:28 PM »
No idea might have failed update for some unknown reason.
Yeah, forget I said that. It's now saying it's at 2.0.13... Well let's see what happens when I run the package manager comparison checks again.

Edit: Yeah, it seems it was either a major failure somewhere, and it never installed, or 2.0.13 also had login modifications and I confused the two. Hoping the session fix included is what I was looking for then :)
« Last Edit: May 31, 2017, 08:29:43 PM by Gwenwyfar »

Offline PPI Karl

  • Semi-Newbie
  • *
  • Posts: 25
Re: Login Error
« Reply #8 on: July 03, 2017, 01:14:58 PM »
This thread has been very helpful.  I've been struggling with this issue since the 2.0.14 update. The previous owner of forum, who was a professional programmer, had done some modifications to the templates that had me thinking either those could be the problem, or the outdated PHP version was responsible. I'm glad to have struck upon your answer.

I'm poised to edit the index.template.php file right now, but I'm a little confused by the semantics of your recommendation:
Quote
code added in the <form> tag  just add in the closing </form> tag in any login form

Do you mean just above where </form> occurs? Also, I already have something there that's similar: <input type="hidden" name="hash_passwrd" value="" />. Should I remove this, or just insert your recommended code in another line just below it?

Thanks for your help.  I apologize if the answers to my questions are really obvious. I'm not very experienced with code.  Your advice is hugely appreciated.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,692
  • Too long in the wasteland
Re: Login Error
« Reply #9 on: July 03, 2017, 01:20:33 PM »
Code: [Select]

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



Offline PPI Karl

  • Semi-Newbie
  • *
  • Posts: 25
Re: Login Error
« Reply #10 on: July 03, 2017, 01:25:18 PM »
Thank you for the clarification.  Much appreciated.  Have a great week.

Offline PPI Karl

  • Semi-Newbie
  • *
  • Posts: 25
Re: Login Error
« Reply #11 on: July 05, 2017, 05:52:07 PM »
Well, unfortunately, I'm back for whatever help can be offered.

I've done everything suggested so far, including updating the PHP and editing the index.template.php as instructed. Yesterday, theme designer Diego Andrés also updated his Gaming Nation theme for the 2.0.14 patch (basically, the index.template.php of this theme now has the exact same addition of code already recommended by SMF). So, to the best of my knowledge, I'm now using the most current versions of everything.

Regardless, that log-in error widely reported since the 2.0.14 patch--"Your session timed out while posting. Please go back and try again"--persists.  It's not an every-time occurrence, but it happens to me at least once a day, and it takes repeated trips back to the log-in page and a few page-refreshes before it'll work.

I've read that customized templates might pose problems, but, as a total novice, I've performed only the most superficial, minor customization so far to the index.css (a change of font size and color, or the addition of a background image to the site--that sort of thing). 

I don't know what else there is to try, but I'm willing to try it. If anyone has hit upon a solution, or can recommend a better approach to this problem, I'd be grateful to hear it. Thank you very much!

Offline sǝๅqɯɐɥS

  • SMF Hero
  • ******
  • Posts: 4,419
  • Gender: Male
    • i30 Owners Club
Re: Login Error
« Reply #12 on: July 05, 2017, 05:59:11 PM »
This appears to be a "solved" topic. Might be wise to open your own topic, otherwise it could get overlooked...

Offline PPI Karl

  • Semi-Newbie
  • *
  • Posts: 25
Re: Login Error
« Reply #13 on: July 05, 2017, 06:00:05 PM »
Will do.  Thanks very much.  :)

Offline TKG26

  • Semi-Newbie
  • *
  • Posts: 80
Re: Login Error
« Reply #14 on: September 11, 2017, 09:01:22 PM »
Thank you vbgamer45 for your assistance on this thread.

I had the exact same issue as the OP.. i just recently went from 2.0.12 to 2.0.14 and got reports from users trying to log in. Your code addition fixed my issue as well


Thanks
www.rcottawa.com