Fixed bug in sessions and paramecio command
This commit is contained in:
parent
45fd250a25
commit
4cf4fbb59d
1 changed files with 4 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ except:
|
||||||
class config:
|
class config:
|
||||||
cookie_name='paramecio.session'
|
cookie_name='paramecio.session'
|
||||||
key_encrypt=create_key_encrypt_256(30)
|
key_encrypt=create_key_encrypt_256(30)
|
||||||
session_opts={'session.data_dir': 'sessions', 'session.type': 'file'}
|
session_opts={'session.data_dir': 'sessions', 'session.type': 'file', 'session.path': 'paramecio'}
|
||||||
|
|
||||||
# Cookie session
|
# Cookie session
|
||||||
# This save the session in a cookie for maximum performance. In next version i can use memcached or something for session
|
# This save the session in a cookie for maximum performance. In next version i can use memcached or something for session
|
||||||
|
|
@ -88,10 +88,10 @@ def generate_session(session={}):
|
||||||
|
|
||||||
token=create_key(30).replace('/', '#')
|
token=create_key(30).replace('/', '#')
|
||||||
|
|
||||||
response.set_cookie(config.cookie_name, token, path=config.session_opts['session.path'])
|
|
||||||
|
|
||||||
s={'token': token}
|
s={'token': token}
|
||||||
|
|
||||||
|
response.set_cookie(config.cookie_name, token, path=config.session_opts['session.path'])
|
||||||
|
|
||||||
request.environ['session']=s
|
request.environ['session']=s
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue