Fixed the bug of session and cookies.