Apply cookie date fix from adios
This commit is contained in:
parent
d119fa3629
commit
0d3f364aac
|
@ -51,6 +51,8 @@ import time
|
||||||
import random
|
import random
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from email.utils import formatdate
|
||||||
|
|
||||||
from twisted.internet.defer import Deferred
|
from twisted.internet.defer import Deferred
|
||||||
from twisted.internet.task import LoopingCall
|
from twisted.internet.task import LoopingCall
|
||||||
|
@ -82,9 +84,9 @@ def get_session_id(session_id):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def make_expires(timeout):
|
def make_expires(timeout):
|
||||||
expires = int(time.time()) + timeout
|
dt = timedelta(seconds=timeout)
|
||||||
expires_str = time.strftime('%a, %d %b %Y %H:%M:%S GMT',
|
expires = time.mktime((datetime.now() + dt).timetuple())
|
||||||
time.gmtime(expires))
|
expires_str = formatdate(timeval=expires, localtime=False, usegmt=True)
|
||||||
return expires, expires_str
|
return expires, expires_str
|
||||||
|
|
||||||
class Auth(JSONComponent):
|
class Auth(JSONComponent):
|
||||||
|
|
Loading…
Reference in New Issue