25Feb/100
Getting session ID in Drupal 6
Drupal saves its sessions in the sessions table. One can always query they table to get the session ID. There is however a faster way.
If the user is logged it, the session id can be found with the following code:
global $user; $user->sid;
In any case the session id can also be read from the cookie:
$_COOKIE[session_name()];