Each time I deploy a Yii application, I change the /var/www symbolic link. Something like this
rm -f /var/www ln -s /var/app-version /var/www
But every time I do this, user sessions become invalid (i.e. all users are logged out, and CSRF tokens were reset).
For the session, I use CCacheHttpSession . Something like below in main.php
'components' => [ 'memcache' => [ 'class' => 'CMemCache', 'servers' => [ [ 'host' => 'localhost', 'port' => 11211, ] ] ], 'user' => [ 'class' => 'WebUser', 'allowAutoLogin' => true, ], 'session' => [ 'class' => 'CCacheHttpSession', 'cacheID' => 'memcache' ] ]
I'm not sure if this incorrect configuration is at the PHP or Yii level, but what did I do wrong?
source share