correct the cookie parsing
fixed the session generation