Forums

Timed logout while editing documents in Web2py

This is far from urgent, but I thought I'd mention it because it's been sort of a nuisance for me. While editing code in the web2py editor, it seems that my secure login to Web2py expires after some time, preventing me from saving my document. I need to copy the whole document, reload the page, login, go back to the editor, and paste the code back into the document. The auto-logout doesn't seem to happen if there's been any activity, but "activity" doesn't include a long spell of code editing; thus, this tends to happen exactly when there's been a lot of changes to a document, which is a bit of a bummer.

Now obviously the solution in my behaviour is that I should just save early and often (this is considered "activity" to prevent a logout), which is just good practice. But I'd really like to be able to walk away from my document to drink a cup of coffee/surf the web idly/take the dog for a walk/etc without having to log back in to Web2py. I can't seem to find a setting that will keep me logged in - does one exist?

I'm afraid I'm not at all familiar with web2py, but does this google groups post help at all?

Looks like there's a setting auth.settings.expiration which might account for what you're seeing. However, I've no idea whether this will affect the online editor, or only the website itself.

If you're talking about the PA login, I've never had that expire for me at all - it seems persistent even if I'm idle for several days.

EDIT: Judging by this document, either the expiration or long_expiration settings are used based on whether the "remember me" option is selected. Looks like the former defaults to an hour, the latter to a month. I'll just re-iterate that I'm not sure whether this is relevant to your issue, it's more an avenue for investigation. (^_^)

I don't know about web2py, but PA uses the browser session for expiration so it shouldn't log you out until you close your browser. Anything else would just be anti-social.

@glenn: Antisocial, yes, but that doesn't stop a surprising number of web applications implementing their own session timeouts server-side. I used to have problems with Dokuwiki at the previous company where it would log me out while I was editing a page and then refuse to accept the edit (thankfully Lazarus was there to save my sanity).

I think we eventually found all the settings we needed to change to beat it into submission, and then the only issue was the occasional server restarts causing the sessions to be wiped server-side, so the client-side cookie was rendered useless.

Thanks guys - I'm definitely talking about the Web2py editor and not the PA editor (which always works great); "anti-social" is a good description. The problem is I can't seem to find the "remember me" option; guess I'll just have to poke around and set the attribute manually.

Well as I said, it's possible those settings don't apply to the editor - I'm simply not familiar enough with it to say for sure. I just thought it looked like something to try, at least.

I don't know Web2py well either, but in the manual it shows (on page 539) there are entries:

16 contimeout 5000
17 clitimeout 50000
18 srvtimeout 50000

in a file named /etc/haproxy.cfg

I didn't look any further to see if this is relevant or will help you, but I hope it does.

@a2j: Worth a look, but I believe that HAProxy is a third-party load-balancer for spreading requests across multiple Web2py instances, and the section of the manual which contains those settings is help in configuring it. I don't think that HAProxy is in use here.

If HAProxy is in use on PA, I'm sure someone will correct me! (^_^)

In that case you're right it's of no use. I just did some cursory looking on the topic and saw the entries with the word timeout in the manual. Of my various searching those were the only results that looked like they could be helpful. Unfortunately prior to my getting to the bottom of the issue I experienced an availability timeout...☺

Meh. The solution was to stop using the web2py IDE; the PA one is worlds better.

+1 for PA...☺