Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FormsAuthentication RedirectToLoginPage Quirk

Using this method after the SignOut() call redirects to '...login.aspx?ReturnUrl=%2fmydomainname%2flogout.aspx' so that the user can't log back in again, since a successful login returns to the logout page. The login page is set in webconfig and the app successfully gets that page. Why would a ReturnURL be stuck on the tail of the URL?

like image 977
Greg Avatar asked Apr 08 '09 18:04

Greg


1 Answers

This is how RedirectFromLoginPage works. It appends the current URL to the query string of the login page. This way, the login page can redirect the user back to the place he where.

If you don't want this to happen, you can manually redirect to the login page using Response.Redirect.

like image 183
mmx Avatar answered Sep 22 '22 08:09

mmx