openresty / encrypted-session-nginx-module

encrypt and decrypt nginx variable values
http://openresty.org
195 stars 52 forks source link

Automatically renew session if there is activity? #4

Open fc28222 opened 11 years ago

fc28222 commented 11 years ago

For example if encrypted_session_expires is set at 1 hour, it seems appropriate to extend the expiry if the user is on the site continuously during that hour.

Seems like encrypted_session_expires is a site-wise property, and even if one manually change the cookie expiry, the backend logic of the module may not follow. I am wondering what would be the best way to implement the above functionality using this module, if it is possible.

agentzh commented 11 years ago

@fc28222 You can just re-generate the session value yourself. The expiration timestamp is directly encrypted into the session data itself.