abstractionz
asked on
Question About Sessions
I'm trying to access the $_SESSION from within a function and it is not working:
show_cart.php
<?
include('functions.php');
session_start();
//code that sets attributes in the session
//code that calls a function in functions.php
?>
functions.php
<?
function display(){
global $_SESSION
// can't access the session here
}
?>
How do I access the session within this function??? I'm using PHP 4.3
show_cart.php
<?
include('functions.php');
session_start();
//code that sets attributes in the session
//code that calls a function in functions.php
?>
functions.php
<?
function display(){
global $_SESSION
// can't access the session here
}
?>
How do I access the session within this function??? I'm using PHP 4.3
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you need more refference to sessions, go here: http://www.php.net/session
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. My problem was actually that the code I was using was bad code, and I fixed it. I thought it might've had something to do with sessions but it didn't.