Jump to content

Every link starts a new session.


darp

Recommended Posts

I am setting up an e-commerce store, and it is misbehaving. I am using osCommerce which is supposed to work if a user has their browser cookies disabled. Without cookies the user is tracked by a session id that is passed on through the URL.

 

However for some reason when I have the cookies disabled a new session is started with every click of the mouse at every link and every submit button. These sessions are stored in the store tmp directory or the mysql db depending on my configuration. They pile up fast while I get nowhere.

 

I have had osCommerce people go over my configuration files ( over 100 have viewed my query ) and they seem to be fine. I downloaded a fresh, virgin catalog to make sure that the one I had had not been corrupted. I got the same results.

 

So far nobody in the osCommerce forum can figure it out,  and they seem to have run out of ideas. It seems the problem does not reside with the osCommerce code. It is the same code everyone else uses without a problem.

 

So my question is, could this be a PHP issue? Is there any PHP configuration setting that I need to set in php.ini?. Is there a module I need?

 

When cookies are enabled the sessions seem to work fine.

 

The site domain is localhost.

 

I am using;

PHP 5.3,

Apache 2.2,

MySQL 5,

Linux 2.6.31.12-0.2-default x86_64.

 

Thank you in advance for any help.

 

Link to comment
Share on other sites

How might I test sessions outside of the application? I have phpBB3 installed, but I believe that only functions with cookies enabled.

 

When I have cookies enabled osCommerce retains $_SESSION and $_GET values. I have tested those with var_dump() and get the results I expect.

Link to comment
Share on other sites

How might I test sessions outside of the application?

 

Write a few little test script and link between them dumping vars as you go. Then test moving between these script with cookies enabled / disabled.

Link to comment
Share on other sites

I wrote a little test script as suggested. You can see the results.

 

test.php

<?php

 

session_start();

 

echo session_id();    //n27kncejcd4rt246037989eqn1jui6bj

 

$_SESSION[id]=session_id();

 

echo "<br />";

 

var_dump($_SESSION[id]);    //string(32) "n27kncejcd4rt246037989eqn1jui6bj"

?>

<br />

<a href="test_two.php" >Test</a>

 

 

 

 

test_two.php

<?php

session_start();

 

echo session_id();    //m9oh3l865ovrgvb2ue6tdlmnrflpevhb

 

echo "<br />";

 

var_dump($_SESSION[id]);  //NULL

?>

 

As you can see, in test_two.php the session_id is reset and $_SESSION[id] is killed.

 

When cookies are enabled everything has the same value as it should.

 

Why? Is this a PHP or a sever problem?

 

The domain is localhost on my personal computer.

 

Linux 2.6.31.12-0.2-default x86_64

Apache2.2

PHP 5.3

 

Tested on Firefox, Konqueror and Opera.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.