FormsAuthentication.SignOut() not working

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.
 
P

Patrick.O.Ige

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\
 
P

parez

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.
 

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

Top