web2py cookies never expire (unless the client deleted cookies) but
authentication does in two ways:
1) it check last acces datetime so you can change the expiration time
in seconds
auth.settings.expiration = 100
2) admin deletes session files that have been unused in a while, so
delete
Ok, thanks
Example:
How do I allow a user to stay logged in to my site for as long as
possible? Or have the site remeber the user? without allowing the user
log in again and again
On May 2, 1:56 am, Massimo Di Pierro
wrote:
> it does.
>
> if 'counter' in request.cookies:
> # retrieve cookie
>
it does.
if 'counter' in request.cookies:
# retrieve cookie
counter = request.cookies['counter'].value +1
else:
counter=1
# set cookie
response.cookies['counter'] = counter
request.cookies[name] is a Morsel Object
http://docs.python.org/library/cookie.html
Massimo
On May 1, 7:36 pm, Pyst
3 matches
Mail list logo