* Thus wrote Paul Liebrand ([EMAIL PROTECTED]):
> I am hosting a web site on tierranet and throughout the day sessions get
> lost. If I take the exact same code and run it on my Windows machine, I can
> run it for a week straight without any problems. I have not been able to
> figure out the problem and was wondering if anyone can provide any
> assistance or feedback.
> 
> At the top of most of my pages I have the following piece of code:
> 
> if (!session_is_registered("valid_user")) {
>     header ("location: logon.php");
> }

using sesion_is_registered() depends on a couple things:
  1. register_globals is on
  2. you are using a super old method of using sessions.

1. if you're relying on register_global to be on that is usually
   frowned upon.  The best method to do sessions is usually with
   $_SESSION, if you're not using an archaic versionn of php.

     // start session
     session_start()
     
     // set a session var
     $_SESSION['var'] =  'a value';

     // check session existence
     if (isset($_SESSION['var']) ) ...

     // unset session var
     unset($_SESSION['var']);


2. read http://php.net/session a couple of time's to verify correct
   usage. and *do* take not of the "warning" sections.



Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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

Reply via email to