Hi,
I want to destroy session when user close the browser tab or window in PHP. Please give me sample code.
Thanks in advance.
William
Hi,
I want to destroy session when user close the browser tab or window in PHP. Please give me sample code.
Thanks in advance.
William
Jump to Post@divya: i don't think you can get browser close event.
It works only on some browser, i have tried it in past.
If your code works in all browser post here for others use.
Jump to PostRefer the following Daniweb post.
http://www.daniweb.com/web-development/php/threads/138791
Load some PHP script at the time of onunload event using ALAX.Use session_destroy function to destroy the session.
Do you have any sample ajax code
@divya: i don't think you can get browser close event.
It works only on some browser, i have tried it in past.
If your code works in all browser post here for others use.
visit the following link.
http://www.w3schools.com/ajax/ajax_example.asp
Try this example with <body onunload> event.
Edit the php file to destroy the session.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.