S
Simon Harvey
Hi everyone,
I'm hoping that someone can help me with the following:
I don't know to much about asp.net security, but I've copied the following
code out of one of microsofts security books. What I'm trying to achieve is
allow a user access to a secured directory only once his details have been
validated. The directory in question "/secure/" is specified in a location
element of the web.config file. The code in question is in my login page and
is:
if(SystemUserLogic.validateUser(username, password)){
authTicket = new FormsAuthenticationTicket(username, false, 15);
encryptedTicket = FormsAuthentication.Encrypt(authTicket);
authCookie = new HttpCookie(FormsAuthentication.FormsCookieName,
encryptedTicket);
Response.Redirect("secure/index.aspx");
}
The problem is that asp.net is denying access to the secure directory even
once I have do the above.
Can anyone see what I have missed out?
Am I right in thinking that this is all I have to do?
Thanks to anyone who can help
Simon
I'm hoping that someone can help me with the following:
I don't know to much about asp.net security, but I've copied the following
code out of one of microsofts security books. What I'm trying to achieve is
allow a user access to a secured directory only once his details have been
validated. The directory in question "/secure/" is specified in a location
element of the web.config file. The code in question is in my login page and
is:
if(SystemUserLogic.validateUser(username, password)){
authTicket = new FormsAuthenticationTicket(username, false, 15);
encryptedTicket = FormsAuthentication.Encrypt(authTicket);
authCookie = new HttpCookie(FormsAuthentication.FormsCookieName,
encryptedTicket);
Response.Redirect("secure/index.aspx");
}
The problem is that asp.net is denying access to the secure directory even
once I have do the above.
Can anyone see what I have missed out?
Am I right in thinking that this is all I have to do?
Thanks to anyone who can help
Simon