Bugfix for cookie handling

If a cookie file exists then check that there is a session cookie as
opposed to either session or login cookie.