Moved session and cookie handling from response to request (easier to use).