Compare commits

..

1 Commits

Author SHA1 Message Date
Juhani Krekelä 9e2a7d338d Start working on authentication 2018-04-08 17:11:42 +03:00
1 changed files with 4 additions and 2 deletions

View File

@ -12,12 +12,13 @@ class HTTPRequestHandler(http.server.BaseHTTPRequestHandler):
encoded = html.encode('utf-8')
length = len(encoded)
# TODO: Make this more sensical
sent_cookies = http.cookies.SimpleCookie()
sent_cookies['buranun_session'] = 'dihutenosa'
#sent_cookies['buranun_session']['domain'] = 'ahti-saarelainen.zgrep.org'
sent_cookies['buranun_session']['domain'] = 'ahti-saarelainen.zgrep.org'
sent_cookies['buranun_session']['path'] = '/board'
sent_cookies['buranun_session']['max-age'] = 60
#sent_cookies['buranun_session']['secure'] = True
sent_cookies['buranun_session']['secure'] = True
sent_cookies['buranun_session']['httponly'] = True
self.send_response(status_code)
@ -37,6 +38,7 @@ class HTTPRequestHandler(http.server.BaseHTTPRequestHandler):
self.__send_html(html, status_code = 404)
def do_GET(self):
# TODO: Do something with the session
cookies_string = self.headers['cookie']
if cookies_string is not None: