Session setup help needed please

echo session_id() will output a different session id on every page/script.

I’m trying to key off a unique browser session for some functionality, but alas can do it if changes every time.
I’ve been changing php.ini, session config settings in web.php > components, but does not help. Doing my best to research this, but has been hours and no doubt is something simple that am overlooking.

Can anyone please advise me what is the correct configuration to have a persistent php session (that obeys the session settings/timeout set in php.ini)? or even a good resource on sessions in general and/or with Yii2?

One added note: it only seems to be happening in my production environment that is setup as https


found it! incorrect root apache permissions on session folder in /var/lib/php/5.6/session

1 Like