session id passed but not session contents

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I'm having a problem with sessions with my shopping cart. It works fine
in my local server at home and office but after uploading the code in
the remote server, the cart contents (session) are no passed to the
cart from products page. At home and office, i am using xampp. The
remote server is using Linux and probably apache.

in my cart.php file, i did this: <?php echo "ID = " . session_id() .
"<br />"; ?> to check if the session id is passed and it shows up but
when I do print_r($_SESSION['cart']['cart_contents']), it contains
nothing. I repeat this same code is working fine at home and office
under xampp. So i am thinking it is something to do with the remote
server. Is there anything i could do in php.ini in the remote server to
get this work? I think there is nothing wrong with my code as it works
under xampp.

Please help!


Re: session id passed but not session contents schrieb:

Quoted text here. Click to load it

Hm, unlikely. My code always worked fine on XAMPP and production
I really wonder, that your production system doesn't come with session

I feel, that there is something in your code, which is related to your
xampp dev-environments.

Could you post a bit more code? How do you open the session and such?

Re: session id passed but not session contents wrote:
Quoted text here. Click to load it

If the session ID is propogating correctly, the most likely cause is
the session handler isn't able to do its job (e.g. no permissions on

Presumably you've got a DBMS available - drop in a DB based session
handler and see what happens - there's plenty available off-the-shelf.


Site Timeline