Re: [phplib] PHPLib and searchengines.. From: jeroen <email protected>
Date: 07/17/00

> >To get rid of your session_id, implement the change I suggested about 1-2
> >week(s) ago on this list.

Copy this two functions in your extended sessions class in local.inc. This
function will then override the function release_token() in session.inc

Greetings
Jeroen.

THE CODE
=========

  function release_token( $sid = "" )

    global $HTTP_COOKIE_VARS, $HTTP_POST_VARS, $HTTP_GET_VARS,
$QUERY_STRING;

    if (isset($this->fallback_mode) && ('get' == $this->fallback_mode) &&
        ('cookie' == $this->mode)) {
      $cookie_set = isset($HTTP_COOKIE_VARS[$this->name]);
      $getpost_set = isset($HTTP_GET_VARS[$this->name]) ||
isset($HTTP_POST_VARS[$this->name]);

      if (!$cookie_set && !$getpost_set) {
        // none - first load of page : set cookie & get and ask for reload
        $this->get_id($sid); // generate session ID and setup cookie
        $this->mode = $this->fallback_mode; // to generate self_url()
including GET
        $this->ask_for_new_request(); // will exit !
      } elseif ($cookie_set && $getpost_set) {
        // both - second load of page : remove id from get and ask for
reload
        $this->get_id($sid);
        if ( isset($QUERY_STRING) )

          $QUERY_STRING = ereg_replace(
            '(^|&)'.quotemeta(urlencode($this->name)).'='.$this->id.'(&|$)',
            '\\1', $QUERY_STRING);
        }
        $this->ask_for_new_request(); // will exit !
      } elseif ($getpost_set) {
        // no cookie : go to fallback_mode
        $this->mode = $this->fallback_mode;
      }
    }
  }

  function ask_for_new_request( $url = '') {
    global $HTTP_HOST, $HTTPS;

    if (!$url) $url = $this->self_url();
    $PROTOCOL = (isset($HTTPS) && $HTTPS == 'on')? 'https' : 'http';
    // and you also need to fix suexec as well if you use Apache and CGI PHP
    header('Status: 302 Moved Temporarily');
    header("Location: $PROTOCOL://$HTTP_HOST$url");
    exit;
  }

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Jeroen Laarhoven, Zwolle, Netherlands
email: jeroen <email protected>
www: http://jeroen.polder.net
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

----- Original Message -----
From: "Diamant-Berger Antoine" <diamant1 <email protected>>
To: <jeroen <email protected>>
Sent: maandag 17 juli 2000 10:40
Subject: Re: [phplib] PHPLib and searchengines..

> Hi !
> >
> >The problem is PHPLIB *always* gives the session_id in the *first* page
of
> a
> >session.
> >To get rid of your session_id, implement the change I suggested about 1-2
> >week(s) ago on this list.
> >
>
> Could you please send it back to me ?? I con't find it on the mailing list
> ....
>
> Thanks :)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>