Fix in session
This commit is contained in:
parent
359cb22a93
commit
7cedf82915
1 changed files with 4 additions and 4 deletions
|
|
@ -91,7 +91,7 @@ class ParamecioSession:
|
|||
self.save()
|
||||
|
||||
|
||||
def get_session():
|
||||
def get_session(max_age=None):
|
||||
|
||||
s={}
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ def get_session():
|
|||
|
||||
if hasattr(request, 'app'):
|
||||
|
||||
s=generate_session()
|
||||
s=generate_session({}, max_age)
|
||||
|
||||
else:
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ elif config.session_opts['session.type']=='redis':
|
|||
|
||||
else:
|
||||
|
||||
def generate_session(session={}):
|
||||
def generate_session(session={}, max_age=None):
|
||||
|
||||
#secret=URLSafeSerializer(config.key_encrypt)
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ else:
|
|||
|
||||
s={'token': token}
|
||||
|
||||
response.set_cookie(config.cookie_name, token, path=config.session_opts['session.path'])
|
||||
response.set_cookie(config.cookie_name, token, path=config.session_opts['session.path'], max_age=max_age)
|
||||
#Set-Cookie: phango_session=n2ro4lghim75p8vjseb5v3lhap; path=/experiment2/
|
||||
#response.set_header('Set-Cookie', '%s=%s; path=%s' % (config.cookie_name, token, config.session_opts['session.path']) )
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue