Session per-variable expiration

20 views
Skip to first unread message

Alan Etkin

unread,
Feb 22, 2013, 7:30:35 AM2/22/13
to web2py-d...@googlegroups.com
It seems that some PHP library provides a way to specify when a session (or wathever PHP similar object) variable should be deleted. I did not find a web2py method to do that. Should we add this to the default session interface?

It would be something like:

def __init__(self):
   
...
   
# controls expiration datetime
   
self._vars_timeouts = dict()

def _clean_vars(self):
   
"method to call after initialization"
   
for var in self.keys():
       
if <var expired>:
           
<delete var>

def var_expires(var, datetime or timedelta):
   
"update ._vars_timeouts for a given variable"
   
...

Reply all
Reply to author
Forward
0 new messages