pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ludwig Lim <lud_nowhere_man@yahoo.com>
To: PostgreSQL Mailing List <pgsql-php@postgresql.org>
Subject: Questions Regarding Sessions
Date: Fri, 21 Mar 2003 21:01:18 -0800 (PST)
Message-ID: <20030322050118.17564.qmail@web80411.mail.yahoo.com> (raw)


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




view thread (3+ messages)  latest in thread

Message-ID: <20030322050118.17564.qmail@web80411.mail.yahoo.com>
Permalink:  ../20030322050118.17564.qmail@web80411.mail.yahoo.com/
Also on:    postgresql.org/message-id/20030322050118.17564.qmail@web80411.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: lud_nowhere_man@yahoo.com
  Subject: Re: Questions Regarding Sessions
  In-Reply-To: <20030322050118.17564.qmail@web80411.mail.yahoo.com>
  References: <20030322050118.17564.qmail@web80411.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox