Fixing bug with auth by cookie.