fixed authentication issue with cookie