[PHPLIB] start function in sessions From: Marcin Badtke (marcin.badtke <email protected>)
Date: 03/29/00

I my session.inc I have function start like this:
  function start($sid = "") {
    $this->set_container();
    $this->set_tokenname();
    $this->release_token($sid);
    $this->put_headers();
    $this->get_id($sid);
    $this->thaw();
    $this->gc();
  }

and release_token is like this:

  function release_token(){
echo '<br>W release_token';
    global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_HOST, $HTTPS;
    if ( isset($this->fallback_mode)
    && ( "get" == $this->fallback_mode )
    && ( "cookie" == $this->mode )
    && ( ! isset($HTTP_COOKIE_VARS[$this->name]) ) ) {
      if ( isset($HTTP_GET_VARS[$this->name]) ) {
        $this->mode = $this->fallback_mode;
      } else {
        header("Status: 302 Moved Temporarily");
        $this->get_id($sid);
        $this->mode = $this->fallback_mode;
        if( isset($HTTPS) && $HTTPS == 'on' ){
        ## You will need to fix suexec as well, if you use Apache and CGI
PHP
          $PROTOCOL='https';
        } else {
          $PROTOCOL='http';
        }
        header("Location: ". $PROTOCOL. "://".$HTTP_HOST.$this->self_url());
        exit;
      }
    }
  }

Is there everything ok ? I am asking because in this example I cant get
index.php3 working. Cookie is not set cause release_token is writing some
header before cookie with session number is set.

Marcin Badtke
Administrator Baz Danych
+48 601 837 404
+48 22 607 53 41

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.