Hi,
I have started to use CDbHttpSession for the session handling. It works very well but I want to store more data in the session table. I know I can use the add() method on the session but that would put the data in to the data column of the session. I want to store information like what action the current user is performing at the moment, the last access time for the user. I also want to build an interface on top of this which queries the session table and gives the administrator a list of all the active users, their last access time and the last action they performed.
I could implement all this like a some kind of spyBehaviour and write this data to a separate table in the data base but that would give me at least two writes to the database for every visitor, I guess that would not be necessary if I could store this data directly in the session.
My thought here is to override the write session method in CDbHttpSession to add specific session data to separate columns in the session table instead of just adding it to the data column.
There could be a new method called something like add2Column("lastAction", "updatePassword") which runs add("lastAction", "updatePassword") and after that populates the separate column lastAction in the session table.
Is this a good idea or can it be done in a better way?
Thanks
/John