adding basic cookie support and updating sessions to use cookies