"paddy_nyr" <mp****@yahoo.com> wrote in message
news:39*************@individual.net...
I place a session_start () within php tags at the top of one of my pages.
Then I get a value and placed it in a php variable called $clientid.
After that, I register the session variable using: session_register
("clientid"); So far o.k. Two pages later, I'm trying to get the value of
that session variable using:
I would recommend against using session_register - see warning about
register_globals here: http://php.net/session_register
Instead you should simply put things in $_SESSION. If you don't want to
type out $_SESSION['client_id'] each time you can still do
$client_id = &$_SESSION['client_id'];
Changes to $client_id will be recorded in the session record.
$viewerclientid = $_SESSION['client_id']; The problem that I'm having is
that while this works in some computers, other users
are having problems. It seems that they lose the value of this session
variable. Both users, the ones that run this successfully and the ones
that
don't seem to be using
IE 6 as a browser on the same version of windows (XP).
Are you using redirects anywhere? You should called session_write_close()
beforehand, as in:
session_write_close();
header('Location: http://mysite.com/somepage.php');
exit(0);
If you do not write out the session before redirecting the browser, there is
a chance that the second page will start up, and read in the session record,
before the first page has finished shutting down and writing the session
record, causing lost session data. I've experienced this before.
HTH,
-Josh