FormsAuthentication (web app)

  • Thread starter Thread starter Cantekin Guneser
  • Start date Start date
C

Cantekin Guneser

i have prepared my web config file as follow;
<authentication mode="Forms" >

<forms name="jedi" loginUrl = "WebForm1.aspx" protection = "All" timeout =
"10" path="/"></forms>

</authentication>

<authorization>

<deny users="?" />

</authorization>

i have write code for login page as follow;

FormsAuthenticationTicket ticket = new
FormsAuthenticationTicket("jedi",false,10);

after here how i can redirect to page that i want

if i use

FormsAuthentication.RedirectFromLoginPage("jedimustdie",false);

it rediretcs me to ReturnUrl

thank in advance
 
Hi,

Instead of using RedirectFromLoginPage function which
redirects to the page initially request or the default
page, use SetAuthCookie or GetAuthCookie which will allow
you to redirect to any page you what.

http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfsystemwebsecurityformsauthenticationcla
ssgetauthcookietopic.asp

http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfsystemwebsecurityformsauthenticationcla
ssgetauthcookietopic1.asp

Hope this helps...

Regards,
Madhu

MVP | MCSD.NET
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top