Fix session cookie
Fix memory leak