* Thus wrote treeml ([EMAIL PROTECTED]):
> 
> There is a function called, session_regenerate_id, for php4.3.2 and above.
> Right now, it just creates a random id.  Is there a way to specify the value
> of the regenerated session_id?  So I can record the SID before I send out
> every time.
> 
> I tried,
> 
> session_id('id_generated_me');
> session_start();
> 
> This code does write a new SID, but it also resets the session.  Which means
> I can't get the data set in the previous session.
> I also tried,

Yes, the problem being that you will always start a new session
this way. You'll have to check to see if the session id already has
been setup.

  if (! $_COOKIE['id_generated_me']) {
    session_id('id_generated_me');
  }

Although technically you can record the SID after the session_start.
  session_start();
  record_the_session(session_id());


> 
>         session_start();
>         setcookie(session_name(), SID_generated_by_me );
> 
> believe it or not, this just puts another cookie in the client browser with
> same "session_name". (I didn't even know that 2 cookies from the same
> domain, with same session name is possible, I thought one would just replace
> the other) And the session is still reading from the old cookie with the old
> SID.

Yes this legal, yet it is up to the client to determain what cookie
value to use. and very unpredictable.

HTH,

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to