My server provider moved from datacenter. While moving something went wrong and the power supply to our dedicated database server failed. They setup a new virtual database as a backup plan so we can continue to keep going. I put back a backup of the data. After this however, Yii session do not seem to work anymore. Just to specify, only the database was effected. My code was just as it is and nothing changed there.
When I try something outside of the framework like:
session_start();
$_SESSION["test"] = 100;
That still works. It will store and I can use the session variable as you would expect. However when I use Yii code like Yii::app()->session["test"] = 100
. I can not recall the data.
Extra information
- Cookies do work. If they did not work. I would get a pop-up every time on page reload. So certain about this.
- "sessionID in cookies is changed everytime on page reload" CORRECTION: Seems the id is not change in the cookies atm.
- No session files are found on the server (I believe this might be the problem?)
- The session file location is writeable (tested in PHP
is_writable(Yii::app()->session->savePath)
returns true) - YiiSession table is being update (cleared it and it does refill again)
- Main.php config contains no component for session (so everything is on default)
- I tried to set some session setting including the auto create database table. I deleted the table and it was automaticly created again.
- YiiSession table contains id and expire
- While the expire date seem rather short, it is still set well in the future
- Went from a dedicated server to a temp virtual server (Both running centOs 6.6 + MySQL).
- Session are stored on a virtual server that has been unaffected by the change.
- Yii::app()->getSession()->getSessionId() returns a sessionId
Any suggestion what could be wrong? It seems rather odd this problems occures after a database server change.
BIG NOTE: Just noticed that in some setting file there is a component->session. It seems we use a custom HttpSession. I guess the problem might be in there. Will look trough it (see why the previous developer decide to create a custom class for this) and then use the default options and see if that fixes it.