first off: I dont know how it was done before d7 so I did not included anything before d7 to this issue.
I really have to vent my anger about cookie handling in drupal. searches for setting cookies showed up the function user_cookie_save()
which works pretty well.
BUT
how the hell are you supposed to figure out how you will be able to retrieve your data?
a function for loading that cookie data? -> no? at least not documented nor used by many of the core modules.
$user->key
-> wrong
so I inspected the cookies themselves - Drupal wrote a cookie in a format like Drupal.visitor.key, so at least the cookie has been set. accessing that cookie turns out to be still a pain in the ass:
for real? $_COOKIE? with some magical detecting how Drupal or whatever formated the cookie value?
$_COOKIE['Drupal_visitor_key']
will do the trick.
this issue took some really valuable hours of my life and I am wondering why theres get or load function for that cookie and why other module developer never complained about this, changed this or at least documented it.
have a good night. maybe a core developer will read this and add a function for that.