Requesting Page??

  • Thread starter Thread starter Charles A. Lackman
  • Start date Start date
C

Charles A. Lackman

Hello, I have made an aspx web application that is using Forms
Authentication. Each unsecure page has a custom user control on it that
will allow the visitor to login and enter secure pages. The question I have
is within the Web.Config file.

under <authentication mode="Forms">
there is "LOGINURL"
because there is not a specific LoginPage I want the user to be redirected
back to the requesting page they attempted the logjn from. Is there a trick
to make this happen? Thanks

Chuck
 
Well, you could track the last known accessed unsecure page in a session
variable. Every time the user visits an unsecure page, you update the
variable to reflect that page. Then when the default loginurl is triggered
when the user tries to access a secure page (this will always happen if you
have forms auth turned on), you'll create a small login page that doesn't
really log in, it just forces a redirection to the page in the session
variable. That way, you get back to your unsecure page with user control
login.

But why? Normal forms authentication can work just fine with a default
loginurl specified in web.config.
 
Back
Top