Cookies and buffering

Discussion in 'ASP General' started by Robert Scheer, Jan 27, 2004.

  1. Hi.

    Can anyone tell me if and why is it really necessary to enable
    buffering to create cookies? I read the MSDN topics about
    response.cookies and response.redirect and there is no line saying
    that response.buffer = true is necessary. I am confused.

    Thanks,
    Robert Scheer
     
    Robert Scheer, Jan 27, 2004
    #1
    1. Advertising

  2. Robert Scheer

    Ken Schaefer Guest

    Cookies are sent as part of the HTTP headers (along with other headers, such
    as the HTTP Status, Expiry and Caching information). This needs to be sent
    *before* any HTTP body information (usually starting with <html> or
    <!DOCTYPE>).

    If you try to set a cookie after you have sent body information, then you
    need to have Response Buffering on. This allows IIS to hang onto all the
    info until server-side processing has finished, organise everything into the
    correct order (HTTP Headers first, then HTTP Body information), and send it
    all out at once.

    Cheers
    Ken

    "Robert Scheer" <> wrote in message
    news:...
    : Hi.
    :
    : Can anyone tell me if and why is it really necessary to enable
    : buffering to create cookies? I read the MSDN topics about
    : response.cookies and response.redirect and there is no line saying
    : that response.buffer = true is necessary. I am confused.
    :
    : Thanks,
    : Robert Scheer
     
    Ken Schaefer, Jan 27, 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. Alex Nitulescu

    Response.Cookies vs Request.Cookies

    Alex Nitulescu, Feb 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    8,516
    Hans Kesting
    Feb 3, 2005
  2. Andy Fish
    Replies:
    3
    Views:
    6,545
    Fredrik Lindner
    Nov 6, 2003
  3. user
    Replies:
    3
    Views:
    678
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Mar 31, 2007
  4. archana
    Replies:
    1
    Views:
    513
  5. _Who
    Replies:
    7
    Views:
    2,699
Loading...

Share This Page