Fixing small bug with cookies session management