logout user when the cookie has expired
fixed unit tests
Merge pull request #235 from Icenium/dragnev/logout-on-expired-cookie

logout user when the cookie has expired