Monday, March 30, 2009

Re: How destroy sessions after close browser windows

Unloading is not the same as closing the window. I don't know if
jQuery has some magic of it's own but unless you use all ajax, frames
or an iframe and attach the script to the top html document, the
unload will fire every time the window reloads (each link clicked).

There is no event for the window being closed that can effectively be
used for this purpose.

/Martin


On Mar 30, 2:52 pm, Eber Freitas Dias <eber.frei...@gmail.com> wrote:
> You can use Javascript.
>
> jQuery, for instance, has a helper event handler that let's you bind
> functions to the "unload" event. Check it out:http://docs.jquery.com/Events/unload#fn
>
> You can make it with raw JS or other libraries... I think jQuery is easier.
>
> So you can make a asynchronous call to a method in your app that cleans the
> session and then closes the window... It's an option...
>
> 2009/3/30 John Andersen <j.andersen...@gmail.com>
>
>
>
>
>
> > Ok, then I understand :) That is a scenario you can't catch, as you
> > don't get any information that the user has closed the window.
>
> > Used timed sessions, so that if the user is inactive for more than X
> > minutes, the session becomes invalid and the user must log in again!
>
> > Use session renew when a user logs in, so that the session used for
> > accessing the site as a visitor (not logged in user) and the session
> > used when the user is logged in, is not the same. Avoids session
> > hijacking!
>
> > Hope this helps you on the way,
> >    John
>
> > On Mar 30, 12:19 pm, Petr Vytlačil <petr.vytla...@gmail.com> wrote:
> > > Hi, I this know but I dont know how destroy session when user close
> > > windows.
> > > THX
>
> > > On 30 Bře, 11:10, John Andersen <j.andersen...@gmail.com> wrote:
>
> > > > Use session destroy as stated in the CakePHP documentation athttp://
> > book.cakephp.org/view/404/destroy
> > > > Enjoy,
> > > >    John
>
> > > > On Mar 30, 11:49 am, Petr Vytlačil <petr.vytla...@gmail.com> wrote:
>
> > > > > Hi i need destry sessions after close browser windows. I need logout
> > > > > user from admin section when he close browser windows. If now close
> > > > > browser windows and startup browser, he can go to admin section. I
> > use
> > > > > CakePHP 1.2.
>
> > > > > THX
>
> --
> Éber Freitas Dias
>
> www.eberfdias.comwww.dejamps.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: