summaryrefslogtreecommitdiff
path: root/hw4/cgi-bin/logout.py
blob: 9d6480016e42e62c8ae59ed1fb44de7cda7820e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python2.7
import Cookie, os, time
import re
import uuid
import cgi
import cgitb

from output import *

cgitb.enable()		## allows for debugging errors from the cgi scripts in the browser

cookie = Cookie.SimpleCookie() # for writing cookies
form = cgi.FieldStorage() # for reading GET data

message = form.getvalue('message')

user = Login()
if not user:
    ShowError()
    exit(0)

RemoveAllUserSessions(user)
RedirectToBoard()