On Mar 2, 4:04 pm, Hiro <[email protected]> wrote:
> Hi everybody,
>
> I'm pretty new in rails so I've been "playing" programming simple app
> one of the was an app with a login and session management. Up to here,
> everything is pretty smooth, as rails; but I have a question that I
> can solve, that's why I'm writing to the group. Is there a way to
> catch the browser close event? I want it to end the users session,
> because if the user close the browser and try to sign in, I get the
> "user already logged" message.
>
well windows do have an onclose event but I'm not sure that an ajax
request fired from there would work (the browser might just destroy
everything associated with the page at that point). Even then you'd
have to deal with browsers crashing, internet connections dropping out
etc. so my advice would be to not relying on detecting the end of
someone's session and make your login code a bit more flexible.
Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---