FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » how to unset session variable when leaving page
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: how to unset session variable when leaving page [message #174687 is a reply to message #174681] Mon, 27 June 2011 22:41 Go to previous messageGo to previous message
dougatmilmacdotcom is currently offline  dougatmilmacdotcom
Messages: 24
Registered: May 2011
Karma:
Junior Member
In article <fdb4f334-c961-4c2c-809e-819767790b5c(at)x12g2000yql(dot)googlegroups(dot)com>, Co <vonclausowitz(at)gmail(dot)com> wrote:
[snip lots of irrelevant stuff]
> Is it possible to clear the session var when leaving the page?

No. Think about it: your PHP script runs on *your server*. Suppose I'm
visiting your web site, then navigate away to, say, Google. That page is
served by *Google's* server -- how do you imagine that it might be possible
for your server to know that I did that?

The *only* thing your PHP script knows about is what gets sent to it from the
browser. There is no way at all by which your script can tell the difference
between these scenarios, because *none* of them result in the browser sending
anything to your script:
a) Your page is still displayed on my screen and I'm looking at it;
b) Your page is still displayed on my screen, but I'm no longer looking at it
because I stepped out for coffee;
c) Your page is still open in my browser but I'm no longer looking at it
because I'm watching something more interesting in a different tab;
d) Your page is no longer displayed on my screen because I navigated to some
other web site;
e) Your page is no longer displayed on my screen because I turned my computer
off and went to bed;
f) Your page is no longer displayed on my screen because alien invaders from
Proxima Centauri have reduced my entire city to a glowing heap of radioactive
slag.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: debugging with Netbeans
Next Topic: get members who have birthday this week
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 01:15:42 GMT 2024

Total time taken to generate the page: 0.04855 seconds