I think this kind of check is only needed for the login submit. Then we don't need this cookie any more.