subdomain question

12 views
Skip to first unread message

krypton

unread,
Dec 31, 2006, 9:48:14 PM12/31/06
to web.py
once i login to yahoo.com
no matter where i go the cookies and logins are used
say i go to mail.yahoo.com or finance.yahoo.com

but if i login into myapp.com in webpy
and then goto test.myapp.com it asks for username and passwd
how do we ensure that this subdomain uses the same session like yahoo

thanks

Krypton

Craig Marshall

unread,
Jan 1, 2007, 5:25:00 AM1/1/07
to we...@googlegroups.com

Again, this is not really a web.py issue, but I googled for "cookies
subdomains", and up came the following link:

http://content.websitegear.com/article/subdomain_tips.htm

It suggests that when you write a cookie, set the domain to .domain.tld,
and it will be accessible to all subdomains. When a user types
domain.tld in the browser, redirect them to www.domain.tld

Cheers,
Craig

blaf

unread,
Jan 1, 2007, 11:31:12 AM1/1/07
to web.py

krypton wrote:
> how do we ensure that this subdomain uses the same session like yahoo

Use flup's session. I ask Allan Saddi to implement this feature and an
hour after everything worked as expected.

http://trac.saddi.com/flup

krypton

unread,
Jan 1, 2007, 2:01:16 PM1/1/07
to web.py
blaf i m using flup sessions
and this is how i invoke them

def session_mw(app):
return SessionMiddleware(DiskSessionStore(timeout=5), app)

and this is the login code is from webpy authentication from
webpy.infogami.com/src

blaf

unread,
Jan 1, 2007, 4:55:23 PM1/1/07
to web.py

use something like that:

def session_mw(app):
return SessionMiddleware(DiskSessionStore, app,
cookieAttributes={'expires':7*24*60*60, 'domain':'.domain.com'})

where expires is how long the session reference is kept and domain the
global used domain.

Reply all
Reply to author
Forward
0 new messages