Persistent User Session even after logout/ browser restart stored into database

(Horizons Horizons) #1


Is there a simple way to create a peristent per user stored session?

I want to stores several values into the database which should be not deleted after logout and are connected to a user.

The stored settings per user should be loaded each time the user logs in.

Currently I storing the information in the normal CDbHttpSession but they are deleted.

I also tried the Yii::app()->user->logout($destroySession=false); functionality which comes with yii v1.7.

which only deletes the values set via setState.

but somehow the session data isn't accessible any more after browser restart (without logout)

and I get a new session_id() is that normal?

allowAutoLogin is set to true

Also also thought about a second session object extended from CDbHttpSession to store the user session data in another table.

But it seems that CDbHttpSession stores any value from $_SESSION into the database.

and somehow I can't get it working so that the data of the second session object is stored into another table instead of yiisession.

Any help appreciated.

regards Horizons

(Itmagetan) #2

I think you must use cookies. This might help.