FormsAuthentication.SignOut() not working

Discussion in 'ASP .Net' started by parez, Oct 30, 2006.

  1. parez

    parez Guest

    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.
    parez, Oct 30, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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.
    >
    Patrick.O.Ige, Oct 31, 2006
    #2
    1. Advertising

  3. parez

    parez Guest

    SignOut did not work for me.

    ANd now its not working any more..


    Patrick.O.Ige wrote:
    > 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" <> wrote in message
    > news:...
    > > 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.
    > >
    parez, Nov 16, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Johnson
    Replies:
    6
    Views:
    3,756
    tharadk
    Jul 24, 2009
  2. Ed West
    Replies:
    0
    Views:
    378
    Ed West
    Aug 23, 2004
  3. Matthias S.
    Replies:
    3
    Views:
    4,062
  4. Patrick Olurotimi Ige

    FormsAuthentication.SignOut() not working in UserControl

    Patrick Olurotimi Ige, Jul 6, 2005, in forum: ASP .Net
    Replies:
    9
    Views:
    1,515
    Patrick.O.Ige
    Jul 8, 2005
  5. ska4reak

    formsauthentication.signout not working too good

    ska4reak, Nov 25, 2003, in forum: ASP .Net Security
    Replies:
    0
    Views:
    117
    ska4reak
    Nov 25, 2003
Loading...

Share This Page