php - Is it efficient to change cookies and save them into database per request? -
i utilize dynamically changing cookies in order maintain user logged in. illustrate, after successful login, login command function saves user session info rememberme
table , creates cookies info. info kept in server user_id
, key
, expiration_date
. if user having valid cookie (namely user_id
, key
, expire time
within cookies match info stored in rememberme
table) tries access user-only accesible page, server creates new cookie different key, , default-period expiration time , updates info within rememberme
table. cycle goes on way. so, user valid cookie maintains logged in , extends session expiration time every request page. question is, how much efficient implement such session management style. create burden server , database?
fyi, utilize php/mysql in amazon ec2 micro windows server development.
why not utilize php sessions? designed tasks this.
http://php.net/manual/en/book.session.php
php mysql session cookies
No comments:
Post a Comment