Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Safari's cookie sort order explained Web Browsers
If you browse your Safari cookies by looking in the Safari preference pane, you'll notice that the cookies seem to in alphabetical order, sorta. It didn't dawn on me until I really looked closely at it -- the domains are sorted alphabetically based on their reverse domain name. So given the following domains:
  • macosxhints.com
  • apple.com
  • php.net
  • whitehouse.gov
  • www.apple.com
  • mozilla.org
they would be sorted in the following order (shown in reverse notation to better explain the sort order logic):
  1. com.apple
  2. com.apple.www
  3. com.macosxhints
  4. gov.whitehouse
  5. net.php
  6. org.mozilla
This reverse notation may seem unfamiliar for anyone not having worked with Java packages, OS X preference files, or one of a host of other places it is used. While it may seem rather unintuitive, it allows "apple.com" and "www.apple.com" to be displayed together in the sorted list. And you wouldn't necessarily want to display them in reverse notation, as that could be equally confusing for users. (For sake of comparison, Firefox sorts cookies based on their normal notation.)
    •    
  • Currently 2.67 / 5
  You rated: 2 / 5 (3 votes cast)
 
[9,595 views]  

Safari's cookie sort order explained | 7 comments | Create New Account
Click here to return to the 'Safari's cookie sort order explained' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Safari's cookie sort order explained
Authored by: club60.org on Sep 12, '05 10:14:13AM

Great hint! Thank you!



[ Reply to This | # ]
Safari's cookie sort order explained
Authored by: azraq27 on Sep 12, '05 07:24:23PM

Nice, that always confused me.



[ Reply to This | # ]
Safari's cookie sort order explained
Authored by: sjk on Sep 12, '05 07:29:37PM

Here's an example of how cookies are sorted by domain in PithHelmet's Cookie Editor:

.apple.com
bugreport.apple.com
.connect.apple.com
connect.apple.com
genius.apple.com
.info.apple.com
docs.info.apple.com



[ Reply to This | # ]
Safari's cookie sort order explained
Authored by: Fil on Sep 13, '05 03:56:03AM

If someone at Apple reads these comments, please autoselect, in the list of cookie domains, the one(s) that we are *currently* browsing.



[ Reply to This | # ]
Safari's cookie sort order explained
Authored by: TvE on Sep 13, '05 04:18:51PM

if SOMEONE wants Apple to fix or change anything then DO NOT (only) post the info in non-Apple forums!

File a bug-report or use the other mechanisms for providing feedback.


There must be a gazillion different forums with a trillion different threads on the internet- but that's no problem for a huge company as Apple to monitor - is itů

just my $ .02



[ Reply to This | # ]
Safari's cookie sort order explained
Authored by: skrawcke on Sep 13, '05 01:59:36PM
the reverse order is actually how dns is supposed to work..
the top level domain like
com
net
gov
org
name
tv
cc
and so on are read first then the domain name like

apple in apple.com

then the next part like
www in www.apple.com

so when DNS reads the domain name it reads it from the right to the left.

[ Reply to This | # ]
Safari's cookie sort order explained
Authored by: Githon on Sep 14, '05 05:22:02AM

And the crowd says, "OoooOOOOooooh".

Thanks for explaining.



[ Reply to This | # ]