When start a new session, the existing session will be removed. (Need future refactoring.)
Refactored the cookie and session handling. Still not final.