|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Javascript and PHP?
Hello,
I have a question. It is possible, that a session in php will be destroyed, although the user didn´t log himself out?! I think that probably a javascript can do this... can anyone help me? Bye cell |
|
#2
|
|||
|
|||
|
RE: Javascript and PHP?
If the session times out or if the user closes the browser then the session is destroyed. I don't think javascript can be used for such a thing because it's client side and php is server side.
|
|
#3
|
||||
|
||||
|
RE: Javascript and PHP?
The session might look like it's destroyed if the client (via javascript or something else) deletes the cookie that stores the session id.
|
|
#4
|
|||
|
|||
|
RE: Javascript and PHP?
Hello,
and how can I achieve this? |
|
#5
|
|||
|
|||
|
RE: Javascript and PHP?
session_destroy() ?
|
|
#6
|
|||
|
|||
|
RE: Javascript and PHP?
I destroy my session with session_destroy()
but how can I achieve, that if someone forgot to logout and he closes the window, that the session will be destroyed also |
|
#7
|
|||
|
|||
|
RE: RE: Javascript and PHP?
Quote:
In short you can't make action on browser close... what you can is make a hidden iframe thats updating the users last seen time every 5 minutes or like, then you have an approx. value of when the user left the site.. ig you get my point? |
|
#8
|
|||
|
|||
|
RE: Javascript and PHP?
You could spawn a popup using the onunload event that targets a script that logs the user out, and then closes itself, however if the user has a popup-blocker this won't work offcourse.
|
|
#9
|
|||
|
|||
|
RE: Javascript and PHP?
Hello,
i don´t know what you are meaning with a hidden iframe... can you explain it to me, e.g. with a code snipplet?? Bye cell |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Javascript and PHP? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|