on-internet
← Community

PHP session_id() breaks session

Stack Overflow ·

TL;DR: I can't get PHP sessions working any more when using session_id($myId) prior to session_start(). My code stopped working properly a couple of weeks ago, after years working. I discovered its source in a really strange server/PHP behaviour. Now that I identified it, I just don't know in which direction to dig further. Given this sessiontest.php script: <?php session_id('123456abcdef'); echo '<br>session_id - BEFORE: ' . session_id(); session_start(); echo '<br>session_id - AFTER: ' . session_id(); I expect following browser output when loading the page (and this is what actually happens

Comments

Sign in or sign up to comment and upvote.

No comments yet.