ncauth_base.py 594 Bytes
import tornado
import tornado.web
from tornado.web import RequestHandler
#import tornado.web
#import tornado.websocket.WebSocketHandler
#import tornado.web.RequestHandler
class ncauth_base(tornado.web.RequestHandler):
    def get_current_user(self):
        #test=RequestHandler.get_secure_cookie_key_version("user");
        #self.write(test)
        for cookie_key in self.request.cookies.keys():
            cookie = self.request.cookies[cookie_key]
            print(cookie_key, cookie['expires'], cookie.output())
        return self.get_secure_cookie("user",min_version=2,max_age_days=1)