FormsAuthentication.SignOut() not working

  • Thread starter Thread starter parez
  • Start date Start date
P

parez

Hi ALl,

I had problem with FormsAuthentication.SignOut(). It wasnt working.

Looked arround and saw a lot of posts and different solutions to the
problem.

And some how (i dont nkow what fixed it) i got it working.

The following code changes that i made did NOT help.

1)Response.Cookies[FormsAuthentication.FormsCookieName].Value = "Crap"
or expires=DateTime.now

2) Response.Cache.SetCacheability(HttpCacheability.NoCache);



This is what worked for me.

Right now I have just one line

System.Web.Security.FormsAuthentication.SignOut();

and this is my web.config
<forms loginUrl="index.aspx" path="/" defaultUrl="MyPage.aspx"
cookieless="UseCookies"/>



I had to change my web.config to get it working.

Hope this will help somebody.
 
Well FormsAuthentication.SignOut(); could have done all that for u.
But the next question is when u click the back button on ur browser do u get
to see
the previous page?
PAtrick\
 
SignOut did not work for me.

ANd now its not working any more..


Patrick.O.Ige said:
Well FormsAuthentication.SignOut(); could have done all that for u.
But the next question is when u click the back button on ur browser do u get
to see
the previous page?
PAtrick\

parez said:
Hi ALl,

I had problem with FormsAuthentication.SignOut(). It wasnt working.

Looked arround and saw a lot of posts and different solutions to the
problem.

And some how (i dont nkow what fixed it) i got it working.

The following code changes that i made did NOT help.

1)Response.Cookies[FormsAuthentication.FormsCookieName].Value = "Crap"
or expires=DateTime.now

2) Response.Cache.SetCacheability(HttpCacheability.NoCache);



This is what worked for me.

Right now I have just one line

System.Web.Security.FormsAuthentication.SignOut();

and this is my web.config
<forms loginUrl="index.aspx" path="/" defaultUrl="MyPage.aspx"
cookieless="UseCookies"/>



I had to change my web.config to get it working.

Hope this will help somebody.
 
Back
Top