how asp.net set cookies? (http level)

Discussion in 'ASP .Net' started by SushiSean, Feb 21, 2010.

  1. SushiSean

    SushiSean Guest

    hi guys. I have question about cookies which asp.net (IIS) send to client.
    For example I use this page
    https://secure.rpmware.com/User/Login

    The headers request and response looks like this

    GET /User/Login HTTP/1.1
    Host: secure.rpmware.com
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.17)
    Gecko/2009122116 Firefox/3.0.17
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: ru,en-us;q=0.7,en;q=0.3
    Accept-Encoding: gzip,deflate
    Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Cache-Control: max-age=0

    HTTP/1.1 200 OK
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Expires: Sun, 21 Feb 2010 12:03:33 GMT
    Server: Microsoft-IIS/7.0
    X-AspNetMvc-Version: 1.0
    X-AspNet-Version: 2.0.50727
    Date: Sun, 21 Feb 2010 12:03:32 GMT
    Content-Length: 13295

    I dont see param "set-cookie" in server response and like i see it return
    html page with lenth 13295. in that html code not exist any javascript for
    set cookies, but if i will check cookies i will see something like

    __utma=1.1047570983.1266754498.1266754498.1266754498.1;
    __utmb=1.1.10.1266754498; __utmc=1;
    __utmz=1.1266754498.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

    where it came from? how to get those values from server response?
    SushiSean, Feb 21, 2010
    #1
    1. Advertising

  2. SushiSean

    Patrice Guest

    Hi,

    These cookies are AFAIK for Google Analytics. You should find that this page
    refences an external js script that ultimately set those cookies... If you
    want to set/retrieve them server side on an ASP.NET page you can use the
    Cookies collection on the Request or Response object.

    --
    Patrice


    "SushiSean" <> a écrit dans le message de
    news:...
    > hi guys. I have question about cookies which asp.net (IIS) send to client.
    > For example I use this page
    > https://secure.rpmware.com/User/Login
    >
    > The headers request and response looks like this
    >
    > GET /User/Login HTTP/1.1
    > Host: secure.rpmware.com
    > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.17)
    > Gecko/2009122116 Firefox/3.0.17
    > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    > Accept-Language: ru,en-us;q=0.7,en;q=0.3
    > Accept-Encoding: gzip,deflate
    > Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
    > Keep-Alive: 300
    > Connection: keep-alive
    > Cache-Control: max-age=0
    >
    > HTTP/1.1 200 OK
    > Cache-Control: private
    > Content-Type: text/html; charset=utf-8
    > Expires: Sun, 21 Feb 2010 12:03:33 GMT
    > Server: Microsoft-IIS/7.0
    > X-AspNetMvc-Version: 1.0
    > X-AspNet-Version: 2.0.50727
    > Date: Sun, 21 Feb 2010 12:03:32 GMT
    > Content-Length: 13295
    >
    > I dont see param "set-cookie" in server response and like i see it return
    > html page with lenth 13295. in that html code not exist any javascript for
    > set cookies, but if i will check cookies i will see something like
    >
    > __utma=1.1047570983.1266754498.1266754498.1266754498.1;
    > __utmb=1.1.10.1266754498; __utmc=1;
    > __utmz=1.1266754498.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
    >
    > where it came from? how to get those values from server response?
    Patrice, Feb 21, 2010
    #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. =?Utf-8?B?ZHBvbXQ=?=
    Replies:
    5
    Views:
    604
    Steven Cheng[MSFT]
    Jan 17, 2006
  2. pabbu
    Replies:
    8
    Views:
    718
    Marc Boyer
    Nov 7, 2005
  3. Guest
    Replies:
    0
    Views:
    413
    Guest
    Jun 20, 2007
  4. _Who
    Replies:
    7
    Views:
    2,652
  5. Phil Powell
    Replies:
    2
    Views:
    184
    Grant Wagner
    Sep 5, 2003
Loading...

Share This Page