How is timing-out set? I lost info when writing something fairly long. #5680
Replies: 4 comments 11 replies
-
|
Losing a long page like that is genuinely maddening, and your instinct to write-then-paste is the right reflex for now. @BillyBoy0823, the short answer is: Session Lifetime is the pref you can see, but it isn't the only clock running. There are three of them, and any one can fire before your 24 hours are up. 1. PHP's own session garbage collection. e107 reads your
The catch is that many shared hosts either ignore that 2. The session cookie itself. The cookie that carries your session id has its own lifetime, also driven off that same pref. If the cookie expires (or the browser drops it), the session on disk may still exist but you no longer present the id to claim it. 3. The form security token. Every admin and content form carries a CSRF token. On current master that token's lifetime tracks the session lifetime rather than being a short separate window, so time alone usually isn't the issue here. What does bite on a long edit is the request fingerprint baked into the token: at the default security level it checks that your IP address still matches the one from when the form was rendered:
If your connection re-handshakes a new IP mid-edit (dynamic home IP renewing, a VPN reconnecting, hopping between WiFi and mobile), the save is rejected as a fingerprint mismatch and you land back at login even though the session technically lived. The longer the edit, the more chances for that to happen. So your workaround is solid, and I'd add: keep the editor tab on a stable connection while drafting, and on shared hosting ask the host (or set in For the longer term, I want to float something past @Deltik rather than promise it: a client-side safety net in the editor. A small periodic autosave of the editor contents into the browser's |
Beta Was this translation helpful? Give feedback.
-
|
I am having more time-out problems. can you suggest a way, the site stops throwing errors if it times out. It comes back is USERNAME undefined and it is happening in a number of spots. Here's one of the errors I get.
I am not sure how to solve this correctly. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you. I added this code to the one culprit: The message comes from a plugin's menu that had restricted access, so I know they were not a guest. But I have MANY menu's and pages, so I will have to go through them and see if I can get away with that code in each one. I would think a better solution would be for e107 to define USERNAME as maybe an UNKNOWN class, so the UNKNOWN who times out gets a message "Please register or Sign in"..... or something along those lines. Thanks for the pointers! |
Beta Was this translation helpful? Give feedback.
-
|
An AHA moment. I am doing a NEW site, and updating my plugins. One of my older plugins, Chatbox II checks for a new message every 20 seconds, so I didn't have the problem. I think that refresh kept things alive when it would post "No new Messages". I could be wrong though. It is not yet compatible with version 2+, and not installed. so that may be why I am just seeing the issue now. But that's only helping ME. I think having the core set USERNAME to a something like an UNKNOWN class would be useful. Even more useful than setting it to GUEST in situations like I ran into with a CLASS I have timing out, and they were not a GUEST. |
Beta Was this translation helpful? Give feedback.





Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was working on my site, and I was writing a nice, long page and when I went to Save it, I lost it all. I was so ticked off. I could not hit "Back" to try to retrieve it either it. I had been logged out.
Lesson learned: Write it elsewhere and Paste.
The thing is, I looked in the Setting and the Session Lifetime was set to 24 hours.
What makes e107 time out, other than the Session_lifetime?
BTW< I did set the session time to 0, and it's still logging me out frequently.
Beta Was this translation helpful? Give feedback.
All reactions