From: | Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com> |
---|---|
To: | PostgreSQL Mailing List <pgsql-php(at)postgresql(dot)org> |
Subject: | Questions Regarding Sessions |
Date: | 2003-03-22 05:01:18 |
Message-ID: | 20030322050118.17564.qmail@web80411.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
Hi:
I have the following small php files, t1.php and
t2.php
t1.php contains the ff:
<?
function func1()
{
global $HTTP_SESSION_VARS;
session_start();
$HTTP_SESSION_VARS["test"]="hello";
session_register($HTTP_SESSION_VARS["test"]);
}
?>
t2.php contains the ff:
<?
include("t1.php");
func1();
session_start();
if
session_is_registered($HTTP_SESSION_VARS["test"]){
echo ("Session is registerd <br>");
$x = $HTTP_SESSION_VARS["test"];
echo ("value of session = $x");
session_destroy();
}
?>
The output I am getting when loading t2.php is the ff:
Session is registered
value of session =
Instead of:
Session if registered
value of session = hello
I've tried testing simple session scripts and it
works, but initializing and using sessions in a
function seems to be a problem for me.
The session is registed, but the value of the
session variable is missing. The session is created
when I look at the /tmp directory and the the file
ses<session id>.
How can I make the script above to work?
Some additional info:
version : php 4
important configuration = --enable-track-vars
--enable-trans-sid --with-apache=<directory>
Thank you very much,
ludwig.
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | apz | 2003-03-22 06:40:42 | Re: Questions Regarding Sessions |
Previous Message | apz | 2003-03-20 14:56:38 | Re: manage stored files via web |