If you use apache there is a way using this script provided by web2py. web2py/scripts/access.wsgi
Some explanations are inside. On Wednesday, 8 August 2012 14:11:17 UTC-5, Yarin wrote: > > I've got a public-facing non-web2py website at our root domain ( > http://ourdomain.com), and a web2py app at a subdomain ( > http://app.ourdomain.com). > > When a user comes to the root site that has a valid logged in session with > our app, I'd like to redirect them to the app subdomain automatically. > > Is there a simple recipe for doing this? I was going to have an IFrame in > the main site load a 'check_loggedin' function from the app, and use > javascript to redirect the parent window to the app if the user was logged > in. But possibly there's an simpler solution using cross-subdomain cookies? > > > --

