Welcome to WebmasterWorld Guest from 18.104.22.168
Forum Moderators: open
Thanks for any help,
I'll make you a deal: I'll tell you how, then you have to answer a question. OK? So here is how:
You can set a variable when the page loads. Say:
visitor_is_leaving = true;
In all your <a...> tags, you include:
In your <body...> tag you include:
The reason is I've got a small php based site administration area that the client must login to access. In windows, when you close the browser, the session ends and the next time they access the admin area they are prompted with a login. Apparently on a Mac, the session doesn't end when the browser closes, so when they return, they waltz right in, without having to login, making them feel it is less secure. I have a logout link that logs them out, but apparently that is just way too inconvenient to use, so I'm trying to develop a fail-safe way of logging them out when the browser window is closed.
Is there no way more simple than adding a variable to all the links to accomplish this?
Thanks for your input.
Sorry I misjudged your intent.
So what you really want to do is destroy the session when the browser moves off your site, not bring up a pop-up. Yes?
I'm not an expert in php sessions, but my intuition is as follows: It might be that the visitor on a Mac who noticed the phenomenon you describe allowed your cookie to be stored, whereas Windows visitors did not. i.e. It might have to do with the security settings on the visitor's machine, and not related to whether they are using a Mac or Windows machine. I'd suggest you have a look at the php manual for entries related to the "session.cookie_lifetime" setting in your "php.ini" file. Also look at the manual entries relating to session_start, session_unset, session_destroy. Hopefully someone with more knowledge on sessions will be able to shed more light.