Calling FormsAuthentication.SignOut() after calling Response.Flush

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFydGluIExlZQ==?=, Sep 28, 2004.

  1. I know that this is something of an old chestnut. Nevertheless, my problem is
    as follows;

    I have a page in which I write html out to the client using
    Response.Write(), followed by Response.Flush(). On the same page, I have a
    logout button that, when clicked, calls FormsAuthentication.SignOut() (after
    which a redirect to a page in another app occurs). As you can guess, clicking
    on this button raises the following exception;

    "Server cannot modify cookies after HTTP headers have been sent."

    Does anybody have any ideas about how I get around this?

    Thanks,


    Martin
     
    =?Utf-8?B?TWFydGluIExlZQ==?=, Sep 28, 2004
    #1
    1. Advertising

  2. Hi Martin,

    I did not understand exactly what you are trying to do. Do you write the
    Response back with Response.Write() and flush it with each request? Then when
    do you do the sign out? Can you give a small example of what you are doing?
    (maybe a code partical?)

    Ethem


    "Martin Lee" wrote:

    > I know that this is something of an old chestnut. Nevertheless, my problem is
    > as follows;
    >
    > I have a page in which I write html out to the client using
    > Response.Write(), followed by Response.Flush(). On the same page, I have a
    > logout button that, when clicked, calls FormsAuthentication.SignOut() (after
    > which a redirect to a page in another app occurs). As you can guess, clicking
    > on this button raises the following exception;
    >
    > "Server cannot modify cookies after HTTP headers have been sent."
    >
    > Does anybody have any ideas about how I get around this?
    >
    > Thanks,
    >
    >
    > Martin
    >
     
    =?Utf-8?B?RXRoZW0gQXp1bg==?=, Sep 28, 2004
    #2
    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. Glen Wilkin via DotNetMonster.com

    Response.Redirect after Response.Flush

    Glen Wilkin via DotNetMonster.com, Apr 15, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    7,092
  2. Signout does not signout.

    , Apr 4, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    490
  3. jobs
    Replies:
    1
    Views:
    703
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2007
  4. IfThenElse
    Replies:
    2
    Views:
    632
    IfThenElse
    Oct 10, 2007
  5. IfThenElse

    FormsAuthentication.SignOut() what to do after

    IfThenElse, Oct 9, 2007, in forum: ASP .Net Security
    Replies:
    2
    Views:
    252
    IfThenElse
    Oct 19, 2007
Loading...

Share This Page