J
Jeff Johnson
I'm using forms authentication to protect a subfolder within my site. I've
got it working fine except for two issues:
(1) When I do a RedirectFromLogin page I have to put a cookie path ("/"
works, or "/mysubdir") or else the auth cookie doesn't get set. I'd like to
know why this is necessary.
(2) When I call SignOut() the auth cookie is not removed, no matter what I
try (no how the cookie is set in the RedirectFromLogin page.
My main web.config has the following entry:
<authentication mode="Forms">
<forms name="MyAdmin" path="admin" loginUrl="admin/adminlogin.aspx"
protection="All">
</forms>
</authentication>
The web.config within the "admin" directory looks like this:
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
As I said, everything works fine except the the SignOut does nothing:
FormsAuthentication.SignOut();
Response.Redirect(ConfigurationSettings.AppSettings["SiteAdminAddress"],true
);
Any suggestions or any idea of a way to workaround this? I tried setting the
auth cookie "MyAdmin" value to nothing... but that didn't work.
Thanks!
got it working fine except for two issues:
(1) When I do a RedirectFromLogin page I have to put a cookie path ("/"
works, or "/mysubdir") or else the auth cookie doesn't get set. I'd like to
know why this is necessary.
(2) When I call SignOut() the auth cookie is not removed, no matter what I
try (no how the cookie is set in the RedirectFromLogin page.
My main web.config has the following entry:
<authentication mode="Forms">
<forms name="MyAdmin" path="admin" loginUrl="admin/adminlogin.aspx"
protection="All">
</forms>
</authentication>
The web.config within the "admin" directory looks like this:
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
As I said, everything works fine except the the SignOut does nothing:
FormsAuthentication.SignOut();
Response.Redirect(ConfigurationSettings.AppSettings["SiteAdminAddress"],true
);
Any suggestions or any idea of a way to workaround this? I tried setting the
auth cookie "MyAdmin" value to nothing... but that didn't work.
Thanks!