mirror of
https://github.com/koniu/recoll-webui.git
synced 2025-10-03 09:49:25 +02:00
Merge pull request #40 from medoc92/master
Changed the value of set_cookie() 'expires' from 3x10**9 3x10**8 (10 years)
This commit is contained in:
commit
ee915fda98
2 changed files with 3 additions and 3 deletions
|
@ -1422,7 +1422,7 @@ class BaseResponse(object):
|
||||||
if key == 'expires':
|
if key == 'expires':
|
||||||
if isinstance(value, (datedate, datetime)):
|
if isinstance(value, (datedate, datetime)):
|
||||||
value = value.timetuple()
|
value = value.timetuple()
|
||||||
elif isinstance(value, (int, float)):
|
elif isinstance(value, (int, long, float)):
|
||||||
value = time.gmtime(value)
|
value = time.gmtime(value)
|
||||||
value = time.strftime("%a, %d %b %Y %H:%M:%S GMT", value)
|
value = time.strftime("%a, %d %b %Y %H:%M:%S GMT", value)
|
||||||
self._cookies[name][key.replace('_', '-')] = value
|
self._cookies[name][key.replace('_', '-')] = value
|
||||||
|
|
4
webui.py
4
webui.py
|
@ -342,10 +342,10 @@ def settings():
|
||||||
def set():
|
def set():
|
||||||
config = get_config()
|
config = get_config()
|
||||||
for k, v in DEFAULTS.items():
|
for k, v in DEFAULTS.items():
|
||||||
bottle.response.set_cookie(k, str(bottle.request.query.get(k)), max_age=3153600000, expires=3153600000)
|
bottle.response.set_cookie(k, str(bottle.request.query.get(k)), max_age=3153600000, expires=315360000)
|
||||||
for d in config['dirs']:
|
for d in config['dirs']:
|
||||||
cookie_name = 'mount_%s' % urllib.quote(d, '')
|
cookie_name = 'mount_%s' % urllib.quote(d, '')
|
||||||
bottle.response.set_cookie(cookie_name, str(bottle.request.query.get('mount_%s' % d)), max_age=3153600000, expires=3153600000)
|
bottle.response.set_cookie(cookie_name, str(bottle.request.query.get('mount_%s' % d)), max_age=3153600000, expires=315360000)
|
||||||
bottle.redirect('./')
|
bottle.redirect('./')
|
||||||
#}}}
|
#}}}
|
||||||
#{{{ osd
|
#{{{ osd
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue