Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Session name

By default PHP session cookie name is PHPSESSID, but by changing it to by example "mysessid" doesn`t change it. How to do it? Code:

$di->set('session', function() {
    $session = new SessionAdapter();
        session_name('my_sess_id');
    $session->start();
    return $session;
});

Request header:

Cookie:PHPSESSID=tje3ovbgfb2393v5hbnmpg6gt7;


82.2k
Accepted
answer

Maybe the session name has not been changed because it only can contain alphanumeric characters:

session_name('mysessid');

Edit: Tested with mysessid and it also work, but previously sent cookies are kept by the browser.



5.3k

Yea, problem was because of _, idk why it didn`t work on my machine... Thanks for support!