Remove session key

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 1
Joined: Thu Nov 14, 2019 11:30 am

Thu Nov 14, 2019 11:35 am

Good afternoon guys, can someone help me with a little session problem.
I am working on maintaining a project where a session key is removed from a session and then null is set on that same key.
When null is set on this key for some reason the session will be back to the previous value on the next request.
I created a minimal example than this attachment. I had never come across this, anyone can explain this behavior.


To run the example:
Call the test.php file with the ini = 1 parameter to start the session key. For example:
Call the test.php file without the ini parameter to perform the session key removal. For example:
(392 Bytes) Downloaded 50 times
php-forum GURU
php-forum GURU
Posts: 653
Joined: Fri Apr 01, 2016 2:18 am

Thu Nov 14, 2019 11:29 pm

Qhy would you set the session key to null? At least all session data would be inaccesible then. But session_destroy() already manages that.
Post Reply