Is there is Session_OnEnd event ON php Like asp ,
if not how can I get a session end time (If there is no proper shut down or connection cut).
Any one have idea about this please help me
Thank u .
Pramod .K.V.P
Is there is Session_OnEnd event ON php Like asp
Moderator: General Moderators
My actual requirement is that .
when client request to my page the i will start a infinate loop to get the aproximate time he is conected with that page . I want to sto the execution of that script when the client close the browser or go to next page or click on stop button of browser .
Please help me to solve the situation.
when client request to my page the i will start a infinate loop to get the aproximate time he is conected with that page . I want to sto the execution of that script when the client close the browser or go to next page or click on stop button of browser .
Please help me to solve the situation.
- AVATAr
- Forum Regular
- Posts: 524
- Joined: Tue Jul 16, 2002 4:19 pm
- Location: Uruguay -- Montevideo
- Contact:
You dont need to make an infinite loop.
When your client request you page, save a timestamp for that user (you can do it un a Database, use the session id to identify the user, or some source of authentication method).
You cant have the moment when the user close the browser with php. What you can do, is register their last activity. In every page the user open you can put a function that update the record of the timestamp.
A table un the DB:
ClientID - TimeStampStart - TimeStampLastActivity.
Or you can make all your script like this:
http://mysite.com/go.php?url=newlink.php
and do the trick in go.php, and after you update that record, just redirect the browser to newlink.php
Hope it helps.
(Damn, i was writing this and when i submit it: phpBB Critical error, cant connect to DB. )
When your client request you page, save a timestamp for that user (you can do it un a Database, use the session id to identify the user, or some source of authentication method).
You cant have the moment when the user close the browser with php. What you can do, is register their last activity. In every page the user open you can put a function that update the record of the timestamp.
A table un the DB:
ClientID - TimeStampStart - TimeStampLastActivity.
Or you can make all your script like this:
http://mysite.com/go.php?url=newlink.php
and do the trick in go.php, and after you update that record, just redirect the browser to newlink.php
Hope it helps.
(Damn, i was writing this and when i submit it: phpBB Critical error, cant connect to DB. )