Jump to content


Photo

destroy sessions when window1 close but window2 still open


  • Please log in to reply
5 replies to this topic

#1 jasonc

jasonc
  • Members
  • PipPipPip
  • Advanced Member
  • 841 posts

Posted 24 May 2006 - 10:49 AM

I use firefox and this also happens in IE.

I login to my site or any site like yahoomail and if i open a new window and visit the same page i am still logged in.

my question is how do i make the sessions only work in the window that started them?

Thanks

#2 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 24 May 2006 - 03:30 PM

You could look into using the javascript "onbeforeunload" to initiate an ajax query to a php script which destroys the session data when the user leaves the page, or closes the window.

Complicated, but it would do the job.
wisewood: proven fact, I am both wise, and wooden.

#3 jasonc

jasonc
  • Members
  • PipPipPip
  • Advanced Member
  • 841 posts

Posted 24 May 2006 - 05:36 PM

i have tried to find out how i use ajax, where i get it on the site, not able to see what i do,

[!--quoteo(post=376706:date=May 24 2006, 04:30 PM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ May 24 2006, 04:30 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
You could look into using the javascript "onbeforeunload" to initiate an ajax query to a php script which destroys the session data when the user leaves the page, or closes the window.

Complicated, but it would do the job.
[/quote]


#4 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 25 May 2006 - 08:07 AM

I will try and find some time later to put together a very basic sample for you.
wisewood: proven fact, I am both wise, and wooden.

#5 jasonc

jasonc
  • Members
  • PipPipPip
  • Advanced Member
  • 841 posts

Posted 25 May 2006 - 10:20 AM

i appreciate it.

thank you

[!--quoteo(post=376920:date=May 25 2006, 09:07 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ May 25 2006, 09:07 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I will try and find some time later to put together a very basic sample for you.
[/quote]


#6 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 25 May 2006 - 10:49 AM

Cant find a way to do it so far.

I'm trying to use the onUnLoad command but its not working properly.
wisewood: proven fact, I am both wise, and wooden.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users