Fixed issue with setting the session ID cookie's age
Multiple bugfixes detected in unit tests