Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session end event

Status
Not open for further replies.

ionutdinulescu

Programmer
Joined
Jun 11, 2002
Messages
59
Location
GB
Can a session end event handler be implemented ? I need to execute php code inside it ( change something in the database ) .
The onbeforeunload event does not work for this as it can only execute client side scripts
 
Nope.

You have to understand how HTTP works. The browser is only connected to the server for the amount of time it takes for the browser to download the HTML stream from the server. After that, the connection is closed.

The server can't know when the browser is closed.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
the onunload could open a quick window to the server and fire off your script before closing the window

Bastien

Cat, the other other white meat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top