durusmail: quixote-users: keep user logged in after restart browser
keep user logged in after restart browser
2006-02-19
keep user logged in after restart browser
Tom Lesters
2006-02-19
I'm using session2 with MySQLSessionStore. and test with the altdemo login,
logout function.

My problem is that sessionID did not save on a cookie file,
When view cookies in FireFox, only one cookie entry for my server, it shows:
Expires: at end of session

While with google, there are several cookie entries and some shows,
Expires: at end of session
but others show different, like,
Expires: Sunday, January 17, 2038 7:00:00 PM

I tried plain cgi(with apache as http server) and  scgi(with lighttpd),
same thing. , after restart browser, it's another session and ask you to
login again.

I also tried altdemo with durus,
you have to comment out one line in altdemo.py:
#    print 'Opening %r as a Durus database.' % filename

then edit a .cgi file(e.g. altdemo.cgi), put:
***************************************************
#!/usr/bin/env python

import sys
import os

if __name__ == '__main__':
    from durussessiondemo import create_durus_publisher
    run(create_durus_publisher)
****************************************************
run it,
same thing, after restart browser, it's another session and ask you to login
again.

I'm confuse how William's browser back to the same session(or different
session but still logged as the same user) after restart?

I guess my question is how to set cookies expiration date to a long time in
Quixote,
such as: Expires: Sunday, January 17, 2038 7:00:00 PM,
so the session will never expire(or user's login never expire)
Do we need to handle it ourselves or William is right, maybe some
configration in Quixote I don't know?

Thanks for all the help!
Tom





On 2/19/06, william@opensource4you.com  wrote:
>
>
> Have you look at Cookbook ?
>
> There is a session manager with DB storge capabilities.
> http://quixote.ca/qx/StoringSessionsInDatabase
>
> mixing that with cookies will solve your problem (I think).
>
>
>
> But I must say that I've never got such problem (lighttpd-1.4.7 +
> quixote-2.1). Browsers will save sessionID in a cookie. Then the browser
> can stop and start (if the server stays up).
> Have you check that your browser will save/manage cookies correctly ?
>
> Problems I've has was concerning multiple threads of the server that are
> not sharing their sessionIDs.
>
>
>
>
>
> Tom Lesters wrote:
> > Hi,
> >
> > Thanks for William for answering my previous question regarding scgi and
> > lighttpd.
> > But is it a bug or it suppose to act lik that?
> >
> > Is there a good way to keep user logged in even after restart browser?
> > For example, when we sign in google account(not gmail) with "remember me
> > on
> > this computer" checked,
> > even we restart browser, we'll still logged in for google account.
> >
> > I understand that I need to set and get my own cookies.
> > What is a good way to do it in Quixote 2.4?  write a subclass of Session
> > and
> > SessionMananger with added handling of my own cookie(not session
> coockie)?
> > or modify Publisher class in someway? Or there is already a package can
> > help
> > me to accomplish it.
> >
> > thanks a lot,
> > Tom
> > _______________________________________________
> > Quixote-users mailing list
> > Quixote-users@mems-exchange.org
> > http://mail.mems-exchange.org/mailman/listinfo/quixote-users
> >
>
>
> --
> William: http://www.opensource4you.com
>
>
reply