Equivalent of OnSessionStart for drupal I am looking for the equivalent or at least a way to run a snippet of code only when the session starts and at now other time do i want this code run.  Can anyone help me with this?  Ive looked around and cant seem to find an answer and all i read about is how drupal is not good with sessions.

What im trying to do is:
Retrieve a value from the URL when the session starts and set a couple variables and cookies according to that variable.  I need to use those cookies throughout in order to retrieve correct results.
I guess you should use hook_init as it's the first hook called right after Drupal setup sessions.