adding cookie and session management logic

serializing a would-be cookie or session value containing a username and
a password