New topic: How to manage concurrent logins when browser is just closed
<http://forums.realsoftware.com/viewtopic.php?t=46886> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message mstrickland Post subject: How to manage concurrent logins when browser is just closedPosted: Sat Feb 09, 2013 6:39 pm Joined: Sat Jan 14, 2012 2:29 pm Posts: 21 My app needs to prohibit concurrent logins. When a user simply closes their browser how can I detect that they have ended that session when they attempt to start a new one? I have a couple of "theories" but I am not sure what would work. Thanks, _________________ Mark [email protected] Top taylor-design Post subject: Re: How to manage concurrent logins when browser is just cloPosted: Sat Feb 09, 2013 10:31 pm Joined: Wed Mar 22, 2006 11:15 am Posts: 544 Location: Southern California The Session.Close event will fire when the user closes their browser window or tab. However, it can take a few seconds to do so. When a user reconnects with a new browser window/tab it will create a new Session regardless of whether or not the previous Session has closed. New windows/tabs always create new Sessions, even if it's the same user from the same browser and they have existing Sessions running. If you have code that checks existing Sessions for a specific login, and a user is fast enough to login in a new window before WE realizes that the old window has closed, then your code will block the new login attempt until WE recognizes that the old window has closed and closes the corresponding Session. _________________ Daniel L. Taylor Custom Controls for Real Studio WE! Visit: http://www.webcustomcontrols.com/ Top jmadren Post subject: Re: How to manage concurrent logins when browser is just cloPosted: Sat Feb 09, 2013 11:55 pm Joined: Tue Aug 31, 2010 11:24 am Posts: 37 Location: Burlington, NC, USA Save a cookie when they log in, and remove it both when they log out and in Session.Close as Daniel explained above. Then when they start a new session, check for the cookie to determine if they should be logged in on this new session. I also include an expiration date/time in the cookie to handle cases where the app crashed or something else prevented the normal removal of the cookie. _________________ -Jay Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
