I am writing PHP code where I want to pass the session id myself using POST. I don't want a cookie to store the session, as it should get lost when the user gets out of the POST cycle.
PHP automatically sets the cookie where available. I learned it is possible to change this behaviour by setting session.use_cookies
to 0 in php.ini
. Unfortunately, I don't have access to that file and I also wouldn't want to break the behaviour of other scripts running on the same server.
Is there a way to disable or void the session cookie inside the PHP script?
EDIT: As the proposed solutions don't work for me, I used $_SESSION = array() at positions in the code where I found the session should be invalidated.