shared session

6 views
Skip to first unread message

Massimo Di Pierro

unread,
May 12, 2008, 10:58:23 AM5/12/08
to web...@googlegroups.com
In trunk now...

session.connect(request,response,masterapp='myotherapp')

and the current app and myotherapp will share sessions and session
cookies. Please try it.

db=SQLDB(....) or GQLDB()
session.connect(request,response,masterapp='myotherapp',db=db)

will do the same for sessions in db.

Massimo Di Pierro

unread,
May 12, 2008, 11:04:17 AM5/12/08
to web...@googlegroups.com
For secure session cookies now just do

session.secure()

and if you do not want to save the session

session.forget()

They work for disk based and db based sessions.

Massimo

Massimo Di Pierro

unread,
May 12, 2008, 11:14:07 AM5/12/08
to web...@googlegroups.com
If you store sessions in DB you can browse them via appadmin. In
trunk 220.

Massimo

voltron

unread,
May 13, 2008, 2:35:50 AM5/13/08
to web2py Web Framework
Great! Thanks

voltron

unread,
May 13, 2008, 2:56:11 AM5/13/08
to web2py Web Framework
Just one thing Massimo, in the course a few posts in the last few days
there were different calls to the new session storage api.

1. Can one still define the table name and it would be created
automatically as you wrote here?
session.connect(request,response,db=db,tablename='mysessions')

2. I assume that this call returns the value of session requested, is
that correct, or one just uses "sessions" as it was in the api before,
it is just transparent, so there is only one 'session' at any given
time ?
session.connect(request,response,masterapp='myotherapp',db=db)

Thanks

mdipierro

unread,
May 13, 2008, 10:04:58 AM5/13/08
to web2py Web Framework


On May 13, 1:56 am, voltron <nhy...@googlemail.com> wrote:
> Just one thing Massimo, in the course a few posts in the last few days
> there were different calls to the new session storage api.
>
> 1. Can one still define the table name and it would be created
> automatically as you wrote here?
> session.connect(request,response,db=db,tablename='mysessions')

yes

> 2. I assume that this call returns the value of session requested, is
> that correct, or one just uses "sessions" as it was in the api before,
> it is just transparent, so there is only one 'session' at any given
> time ?
> session.connect(request,response,masterapp='myotherapp',db=db)

no, it changes the curent session. There is only one session object.
Reply all
Reply to author
Forward
0 new messages