Fixed authentication via cookies file

It also fixes the problem with the chrome extension, see #6.