implement a simple session manager and cookies