How are cookies named when stored on a client machine?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vince C.

    How are cookies named when stored on a client machine?

    Hi.

    I'm trying to work with cookies from ASP and I've noticed cookies are stored on
    my machine in two distinct forms. the first form is "Cookie:<us er name>@<web
    site>", which is a combination between my current logon ID and the visited web.
    The second is "<name>".

    I get the second form when I send a cookie from ASP script using the following
    instructions:

    <%@ Language=JavaSc ript %>
    <%
    function setCookie( szName, szValue )
    {
    Response.Cookie s(szName).Item = szValue;
    Response.Cookie s(szName).Expir es = "10/10/2004";
    }
    ....
    %>

    The value in szName becomes the cookie name. Note however the cookie *address*
    is like any others: "Cookie:<us er name>@<web site>".

    How did I get those cookies in the first form? Is the second form IIS-specific?

    Thanks,
    Vince C.


  • MSFT

    #2
    RE: How are cookies named when stored on a client machine?

    Hi Vince,

    Different browsers store cookies in different ways. Internet Explorer
    stores the cookies for a site in a file whose name is in the format
    <user>@<domain> .txt, where <user> is your account name. For example, if
    your name is mikepope and you visit the site www.contoso.com, the cookies
    for that site will be in a file called mikepope@www.co ntoso.txt. (The name
    might include a sequential number, such as mikepope@www.co ntoso[1].txt.)
    The cookie text files are user-specific, so they are isolated by account.

    regarding the question, I think you first need ensure your logon as windows
    account to that IE can found the user name and web site.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)



    Comment

    • Vince C.

      #3
      Re: How are cookies named when stored on a client machine?

      "MSFT" <lukezhan@onlin e.microsoft.com > a écrit dans le message de
      news:%231j%23mR JtDHA.636@cpmsf tngxa06.phx.gbl ...[color=blue]
      > Hi Vince,
      >
      > Different browsers store cookies in different ways. Internet Explorer
      > stores the cookies for a site in a file whose name is in the format
      > <user>@<domain> .txt, where <user> is your account name. For example, if
      > your name is mikepope and you visit the site www.contoso.com, the cookies
      > for that site will be in a file called mikepope@www.co ntoso.txt. (The name
      > might include a sequential number, such as mikepope@www.co ntoso[1].txt.)
      > The cookie text files are user-specific, so they are isolated by account.
      >
      > regarding the question, I think you first need ensure your logon as windows
      > account to that IE can found the user name and web site.[/color]

      Thanks, Luke.

      However I was mistaken when I described the second form. Instead of "<name>" I
      should have written "<folder>". For instance, I created a web application on my
      machine; when I browse http://localhost/webfolder and there is a cookie
      involved, it is named "/webfolder" instead of "Cookie:<lo gon name>@localhost ".

      I'd like to know why and when cookies are named differently. I mean the name
      that is displayed when you browse your temporary Internet files folder and use
      "Details" as a display mode. My cookie *file* name has the same syntax as the
      others but the *name* of the cookie is different. So I was not talking about the
      file name.

      To make it short why and when do I have cookie names like "/webfolder" and
      others like "Cookie:VinceC@ yoursite.com"?

      Vince C.


      Comment

      • MSFT

        #4
        Re: How are cookies named when stored on a client machine?

        Hi Vince,

        Cookie has the "path" property. If you put the asp file in "/AppName", the
        cookie will be like

        User@AppName

        If you put it in the wwwroot folder, it will be like

        User@localhost

        or

        User@ComputerNa me

        If your web server has a domain name like "www.mydomain.c om", it will be:

        user@domain.com

        Luke
        Microsoft Online Support

        Get Secure! www.microsoft.com/security
        (This posting is provided "AS IS", with no warranties, and confers no
        rights.)

        Comment

        • Vince C.

          #5
          Re: How are cookies named when stored on a client machine?

          "MSFT" <lukezhan@onlin e.microsoft.com > a écrit dans le message de
          news:aFOn$pXtDH A.1576@cpmsftng xa06.phx.gbl...[color=blue]
          > Hi Vince,
          >
          > Cookie has the "path" property. If you put the asp file in "/AppName", the
          > cookie will be like
          >
          > User@AppName
          >
          > If you put it in the wwwroot folder, it will be like
          >
          > User@localhost
          >
          > or
          >
          > User@ComputerNa me
          >
          > If your web server has a domain name like "www.mydomain.c om", it will be:
          >
          > user@domain.com
          >
          > Luke
          > Microsoft Online Support[/color]

          Thanks a lot, Luke.

          Vince C.


          Comment

          Working...