D
Donald Williamson
Hi
Hope someone can help me with authentication and how the redirects work. I'
ve already tried searching previous posts but didn't really find anything.
for I have a page that checks to see if the user has logged in. If not, it
redirects them to the login page for authentication. After authenticating, I
want to redirect them back to the original page that sent them. I always get
redirected back to the default page. I noticed that the '?RedirectURL'
parameter is not being set so my question is how does this get set?
Here's me web.config code"
<authentication mode="Forms" >
<forms
name="fpSupport"
path="/"
loginUrl="Accounts/Login.aspx"
protection="All"
timeout="30">
</forms>
</authentication>
Here's the code that redirects them to the login page if they are not
authenticated:
If Not Context.User.Identity.IsAuthenticated Then
Response.Redirect("Accounts/Login.aspx")
End If
And here's the code on the login page after they have been authenticated:
FormsAuthentication.SetAuthCookie(UserName.Text, chkPersist.Checked)
FormsAuthentication.RedirectFromLoginPage(UserName.Text,
chkPersist.Checked)
Any assistance would greatly be appreciated!
- Donald
Hope someone can help me with authentication and how the redirects work. I'
ve already tried searching previous posts but didn't really find anything.
for I have a page that checks to see if the user has logged in. If not, it
redirects them to the login page for authentication. After authenticating, I
want to redirect them back to the original page that sent them. I always get
redirected back to the default page. I noticed that the '?RedirectURL'
parameter is not being set so my question is how does this get set?
Here's me web.config code"
<authentication mode="Forms" >
<forms
name="fpSupport"
path="/"
loginUrl="Accounts/Login.aspx"
protection="All"
timeout="30">
</forms>
</authentication>
Here's the code that redirects them to the login page if they are not
authenticated:
If Not Context.User.Identity.IsAuthenticated Then
Response.Redirect("Accounts/Login.aspx")
End If
And here's the code on the login page after they have been authenticated:
FormsAuthentication.SetAuthCookie(UserName.Text, chkPersist.Checked)
FormsAuthentication.RedirectFromLoginPage(UserName.Text,
chkPersist.Checked)
Any assistance would greatly be appreciated!
- Donald