Destroy PHP session on page leaving

前端 未结 7 1208
轻奢々
轻奢々 2020-12-06 02:52

I need to destroy a session when user leave from a particular page. I use session_destroy() on the end of the page but its not feasible for me because my page h

7条回答
  •  旧时难觅i
    2020-12-06 03:03

    To trigger when the user actually leaves the page, you must use Javascript to send an asynchronous request back to the server. There's no way for the server to magically know the user has "left" a page.

    See http://hideit.siteexperts.com/forums/viewConverse.asp?d_id=20684&Sort=0 .

提交回复
热议问题