In my controller I have a login method. There I check credentials and if everything is ok call
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
It works but if I immediately check
this.User.Identity.IsAuthenticated
inside a controller I see that it is still false. I need to refresh a page to see that user is indeed authenticated. Is there a possibility to make user authenticated immediately, during the same request? Other partial views which are rendered after depend on it.
In web forms development I would call something like
RedirectFromLoginPage
but here it is inside partial view rendered from a layout file, I can't redirect from there.