Best approach for keeping a session alive

128 views
Skip to first unread message

Thadeus Burgess

unread,
Jan 6, 2010, 12:56:24 PM1/6/10
to web...@googlegroups.com
So I have my blog... and I'm writing a post, and I walk off and leave
it, come back to post, and of course my session has expired.

What is the best way to keep this session alive? I am thinking an AJAX
call that is set to interval at every minute ?

-Thadeus

mdipierro

unread,
Jan 6, 2010, 2:53:32 PM1/6/10
to web2py-users
kpax does this.

Thadeus Burgess

unread,
Jan 6, 2010, 3:02:29 PM1/6/10
to web...@googlegroups.com
(this) being using ajax calls or (this) being keeping the session alive?

-Thadeus

> --
> You received this message because you are subscribed to the Google Groups "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to web2py+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
>
>
>
>

mdipierro

unread,
Jan 6, 2010, 3:45:31 PM1/6/10
to web2py-users
ajax calls to keep session alive

On Jan 6, 2:02 pm, Thadeus Burgess <thade...@thadeusb.com> wrote:
> (this) being using ajax calls or (this) being keeping the session alive?
>
> -Thadeus
>

Richard

unread,
Jan 6, 2010, 6:08:39 PM1/6/10
to web2py-users
how about setting a huge timeout?

Thadeus Burgess

unread,
Jan 6, 2010, 9:44:34 PM1/6/10
to web...@googlegroups.com
I don't know... There are times where I have completely forgotten
about the fact I was writing a post to begin with... so many hours
went by before I got back to it. I would still have the problem if I
left it longer than the session was set for... I would still have to
copy everything over to an external editor just in case, while I log
back in.

I think the best solution is to just not walk off and leave a post
open in mid-edit :)

But I could employ a couple of other measures, like auto-saving the
post, or using ajax to keep the session alive. I think auto-saving
might be the best option, since it will save the post but the session
will time out, that way nobody could sit down at my computer while I
am logged in as admin to the site, but I don't lose what I was working
on.

-Thadeus

selecta

unread,
Jan 7, 2010, 8:40:27 AM1/7/10
to web2py-users
on the thought of huge timeout/no timeout
is there a implementation of "remember me" out there that I can look
at, I want this feature for my page at some point and if is an
implementation out there it would be nice to share!

just in case, i guess what "remember me" does on most pages is to not
delete the session "at all"

Wes James

unread,
Jan 7, 2010, 10:31:12 AM1/7/10
to web...@googlegroups.com
That is why it would be nice to have workflows like plone. You can
create/edit an item and then when you are done "publish" it. You
would still need to save it to not get a login timeout, but people
would not see it until you were ready.

-wes

On Wed, Jan 6, 2010 at 7:44 PM, Thadeus Burgess <thad...@thadeusb.com> wrote:
> I don't know... There are times where I have completely forgotten
> about the fact I was writing a post to begin with... so many hours
> went by before I got back to it. I would still have the problem if I
> left it longer than the session was set for... I would still have to
> copy everything over to an external editor just in case, while I log
> back in.
>

<snip>

Richard

unread,
Jan 7, 2010, 4:57:29 PM1/7/10
to web2py-users
is there a way to disable timeout and have sessions last forever? That
would be useful for my intranet app where security is not an issue.

Wes James

unread,
Jan 7, 2010, 5:00:22 PM1/7/10
to web...@googlegroups.com
look in db.py

## if no need for session
# session.forget()

Just don't use sessions.

On Thu, Jan 7, 2010 at 2:57 PM, Richard <rich...@gmail.com> wrote:
> is there a way to disable timeout and have sessions last forever? That
> would be useful for my intranet app where security is not an issue.
>

<snip>

Richard

unread,
Jan 10, 2010, 6:35:23 PM1/10/10
to web2py-users
I need sessions though, because each user has different roles. Just
once they login I want the session to last until they logout.


On Jan 8, 9:00 am, Wes James <compte...@gmail.com> wrote:
> look in db.py
>
> ## if no need for session
> # session.forget()
>
> Just don't use sessions.
>

mdipierro

unread,
Jan 10, 2010, 6:52:50 PM1/10/10
to web2py-users
The session object itself never expires. Only the auth session
expires. There is a

auth.settings.expiration = 3600

which you can make very very long.

Reply all
Reply to author
Forward
0 new messages