Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

how to expire session on window close

9 views
Skip to first unread message

Varun Goel

unread,
Jan 23, 2008, 6:30:12 AM1/23/08
to rubyonra...@googlegroups.com
Hi all,
I created one login page using LDAP server authentication now when
i have logged into the system and without logout i just closed the
window and when i again come and open the window it's come as log in.
But it should not show as already login.
Please tell me that how can i expire session on window close.
Thanks & regards
Varun Goel
--
Posted via http://www.ruby-forum.com/.

Frederick Cheung

unread,
Jan 23, 2008, 8:24:10 AM1/23/08
to rubyonra...@googlegroups.com

On 23 Jan 2008, at 11:30, Varun Goel wrote:

>
> Hi all,
> I created one login page using LDAP server authentication now
> when
> i have logged into the system and without logout i just closed the
> window and when i again come and open the window it's come as log in.
> But it should not show as already login.
> Please tell me that how can i expire session on window close.

You can't do this 100% reliably. You could try an ajax request from
onClose that would log the user out (but of course that will cause
problems if the user has 2 windows open and closes 1).

Fred

Long

unread,
Jan 23, 2008, 11:26:13 AM1/23/08
to rubyonra...@googlegroups.com
"Varun Goel" writes:
>
> Hi all,
> I created one login page using LDAP server authentication now when
> i have logged into the system and without logout i just closed the
> window and when i again come and open the window it's come as log in.
> But it should not show as already login.
> Please tell me that how can i expire session on window close.
>
We faced the same issue on FATdrive.tv plus we also want to have a single sign on per account.

Our solution is to log the sign in user and monitor for extended period of inactivity. If the
threshold is reached we force the session to expire and expires the log entry (either delete or
change its status).

If the user signs out everything is fine. In the case that he doesn't we check for an open session
(log entry) at next login. If an entry is found we expire it and create a new one. This is because
the user may be trying to login a second time or they had not logged out previously.

Basically, we employ both Rails session and our log entry (OnlineSession) to manage user sessions.
Though, the bulk of the work is done in OnlineSession.

Hope this help point you in the right direction.

-- Long
http://FATdrive.tv/wall/trakb/10-Long
http://FATdrive.tv/ - store, play and share


Reply all
Reply to author
Forward
0 new messages