Store and retrieve session id to and from cookie.