Jump to content

Way to unset session before any javascript executed?


Mudsaf

Recommended Posts

 

then try this way :)

<?phpif(session_destroy()) {echo '<script>alert("Session destroyed")</script>';}?>

 

I didin't want session to be destroyed, but i noticed the error somewhere else. Thx for your time tho :)!

Edited by Mudsaf
Link to comment
Share on other sites

PHP is server side. JS is client side. PHP executes first before any content gets sent to the browser. If you want to do something with $_SESSION before anything is done in the browser, do it in the PHP.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...