FormsAuthentication.RedirectFromLoginPage Reload Page

I am using .Net memebership system and now I had no real problems with this. Now I have an overlay where the user can create a profile. When the profile is created, I just want to redirect to the same page and not to the default page or a return URL that does not exist.

I tried to stop the response of FormsAuthentication.RedirectFromLoginPage, but with no effect:

FormsAuthentication.RedirectFromLoginPage(username, false); // End the redirect so it doesnt redirect to default url (front-page) Response.End(); Response.Redirect(Request.RawUrl); 

Does anyone have an idea how to solve this?

0
source share
1 answer

Use this instead:

 FormsAuthentication.SetAuthCookie(username, false); Response.Redirect(Request.RawUrl); 
+1
source

Source: https://habr.com/ru/post/1347701/


All Articles