To be honest, it is a little odd that PHP session won’t be destroyed after Apache server got restarted. In order to truly kill the PHP session, especially during development, I created a piece of following code, and ran it everything I wanted to have a clean start:
session_start();
unset($_SESSION['session_name']);
session_destroy();
This is because by default PHP saves session to files. Restarting apache will not do anything to clear out these files. See http://php.net/manual/en/session.configuration.php#ini.session.save-handler
This is because by default PHP saves session to files. Restarting apache will not do anything to clear out these files. See http://php.net/manual/en/session.configuration.php#ini.session.save-handler
So, do you think it’s odd? Imagine having a website with a few hundred customers with products in their shopping cart, and for some reason, you need to quickly restart the Apache server because you made a modification in the configuration file. Would you want all of your customer losing their sessions? Would you like it to happen to you? Losing all of your items in your shopping cart after a long time of search, investigation, comparison etc.. ?? It would get you very frustrated I’m sure.
Cheers man!
This makes sense! Thanks!
So, do you think it’s odd? Imagine having a website with a few hundred customers with products in their shopping cart, and for some reason, you need to quickly restart the Apache server because you made a modification in the configuration file. Would you want all of your customer losing their sessions? Would you like it to happen to you? Losing all of your items in your shopping cart after a long time of search, investigation, comparison etc.. ?? It would get you very frustrated I’m sure.
Cheers man!
This makes sense! Thanks!