Remove session key

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
abandeira
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: http://127.0.0.1/test.php?ini=1
Call the test.php file without the ini parameter to perform the session key removal. For example: http://127.0.0.1/teste.php
Attachments
teste.zip
(392 Bytes) Downloaded 46 times
chorn
php-forum GURU
php-forum GURU
Posts: 614
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