Fixed auth to store cookie after authenticated