How To End Or Terminate A Session In Php With Destroy() Function
- Forums
- PHP
- How To End Or Terminate A Session In Php With Destroy() Function
This Page Contains information about How To End Or Terminate A Session In Php With Destroy() Function By wallpaperama in category PHP with 0 Replies. [1251], Last Updated: Sat May 18, 2024
wallpaperama
Mon Feb 09, 2009
0 Comments
369 Visits
session_destroy();
if you want to know how you can terminate or end a session in php, its easy all you have to do is use this function:
session_destroy();
but, use it carefully because it will finish all the sessions for this user, so if there are other session you have, its better to just empty the session your started.
for example lets say you have a login session like this:
$_SESSION['password'] = *******;
so to clear this session it would be just better to declare it with false like this:
$_SESSION['password'] = false;