a record is created in the session table with an empty data, If i hit refresh button another one is created and so on…
How can i make a record to be persistent for each user? if i do this:
Yii::app()->session['test'] = 'test';
It saves a new record for each refresh i make, when will it clear those inserted records? how can i make it so it will add only one record per member per session item?
I would start debugging by specifying cookieMode to ‘only’. You should be aware that the current implementation will store each session as a single row by serializing session data.
That’s the problem, I don’t want it to store a new record each time it is called. I would like it to be distinct on a member basis and on a key basis so if i call:
Yii::app()->session[‘test’] = ‘test’;
Yii::app()->session[‘test’] = ‘test1’;
twice it will first store the first instance then override it with the second one. Then i will have ‘test1’ in that record in the DB. And it will only create one record for each session key for each member.
In other words, how can i store something that will exists in between requests?
I believe your problem is related to session id. Maybe you misconfigured your session cookie, so a new session is instantiated each time your browser sends a request.
OK i did that, and i found out that the session value saved in the cookie does not match the ids in the database. and when ever i call the Yii::app()->session it creates a record in the DB. i think it’s because the cookie and the id in the DB are not matched.