CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

Disable session regeneration

Open aanbar opened this issue 13 years ago • 7 comments

I save session id in the database to avoid multiple logins with same account,

This would cause an account to be kicked out when the session is regenerated.

So it's nice to have an option to disable this feature or control it some way to send back session id so I can store the new one.

aanbar avatar Apr 10 '13 12:04 aanbar

Doesn't the Session library update it in the database? I believe it is designed to do so.

narfbg avatar Apr 10 '13 12:04 narfbg

I am using native session driver & Saving the session id along with the user info to prevent duplicated logins with 1 account.

aanbar avatar Apr 10 '13 12:04 aanbar

I see ... Well, currently you only have the option of updating the session ID in your database table if it doesn't match.

However, I don't see why you're using the "native" driver if you want to store sessions in the database - that's effectively storing them twice.

narfbg avatar Apr 10 '13 12:04 narfbg

I have 4 back-ends in one application, And I'm storing the session id only in the relevant account's table for each back-end to prevent logging-in multiple times with the same account.

I am thinking if it's possible to merge it in the driver for the upcoming version with the ajax fix.

if( $config['sess_disable_regenerate'] === FALSE )
   // regenerate the session

aanbar avatar Apr 10 '13 15:04 aanbar

This is already implemented now, it just requires a note in the config file

sess_time_to_update -- set to zero to disable session re-generation.

aanbar avatar Oct 29 '13 11:10 aanbar

OK, do you want to update it yourself via a pull request or should I do it?

narfbg avatar Oct 29 '13 11:10 narfbg

You can update it, I don't have the repo on this computer

aanbar avatar Oct 29 '13 11:10 aanbar