On Tuesday, December 6, 2011 10:27:42 PM UTC-5, Saurabh S wrote: > > Hi , > > I am developing an online booking system in web2py framework. > > > 1. I want to have the functionality where a user will be logged out > after some time(say 1 hour) if the system remains idle. > auth.settings.expiration defaults to 3600 (i.e., 1 hour)
> 2. The user will be logged out if the browser window is closed > Auth depends on the session, which depends on a session cookie in the browser, which I believe should automatically expire when the browser closes (not just the tab being used for your app, but the whole browser). I'm not sure if there's a way to detect when a single tab is closed (you can use jQuery unload(), but that will trigger on a page reload or back button as well). Anthony