subdomain question

瀏覽次數:12 次
跳到第一則未讀訊息

krypton

未讀,
2006年12月31日 晚上9:48:142006/12/31
收件者: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

未讀,
2007年1月1日 清晨5:25:002007/1/1
收件者: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

未讀,
2007年1月1日 上午11:31:122007/1/1
收件者: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

未讀,
2007年1月1日 下午2:01:162007/1/1
收件者: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

未讀,
2007年1月1日 下午4:55:232007/1/1
收件者: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.

回覆所有人
回覆作者
轉寄
0 則新訊息