Fix cookie setting/deleting

Not sure why this worked locally but not in prod.
Abstract session expiration time
Refactor configuration-related code, add cookie configs