Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Cookie Naming

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cookie Naming

    If I have a windows login set up on my computer, say "xyz", then cookies placed on my drive all are named "xyz@" something or other... How do sites reference my windows defined identity when they go to write a cookie?

    G

  • #2
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    They don't.

    If someone else logs on then the cookies will be different.
    Websites have no control over that sort of thing.
    Omnis mico antequam dominus Spookster!

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, thanks. But how do the cookies get named the way they do on my hard drive? If I write a cookie from a website, under what name can i expect to find it?
    G

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Whatever you name the cookie when you create it, will be the name you see it on your harddrive. If you created a cookine named "username", you'd have username@yoursite.com or something, in your cookies folder

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, thanks. Sorry if I am being dense, but this is exactly what is confusing me. I have two logon ids on my w98 system - let's call them user "abc" and user "xyz". So there is a cookie directory for each. If I go to the NY Times site under both of the respective logns, I will get a cookie abc@nytimes1.txt in the one subdirectory and xyz@nytimes1.txt in the other cookies subdirectory. So isn't windows getting involved and adding the user piece on to the cookie? If I have no logon id, by the way, then the cookie gets written as anyuser@nytimes1.txt. Did the nytimes site just write it as nytimes1.txt and windows added the abc@ ?
    G

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There are two names involved here, one is the cookie name (which is set by the web server) and the other is the file name that Windows stores the cookie data in. Windows is generating the file name "userid@nytimes1.txt", not the web server.

    IE doesn't send the file or file name to the web server when you browse to the site. It just uses the file to store cookies.

    Apparently, it uses different files for different combinations of users and domains. Makes sense if you want let one user have a different set of cookies for a given site from another user.

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Brainjar - Thanks. Since I posted I created some cookies and looked at this, and yes, it is just as you say. The cookie file Windows has named, and contained in it are the cookies I set from the server, using php. It looks like the file essentially contains all active cookies set form that site. I guess when I reference the cookie from the server in order to inspect a setting, Windows simply searches for the cookie file based on site url and the Windows naming convention, and then chains through the file contents.

    G


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •