Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cookies & Sessions Problem [Modified Osc]


FWR Media

Recommended Posts

Posted

Hi

 

I'm in the process of modifying Osc to run as a function from the index.php of mysitebuilder (my web builder manager) but I can't get login or add to cart to work.

 

Note:

This is running on localhost and if I set SESSION_RECREATE to "True" I then get ..

 

Fatal error: session_start(): Failed to initialize storage module: user (path: C:\WINDOWS\TEMP) in C:\Program Files\Apache Group\Apache2\htdocs\shop\includes\functions\sessions.php on line 67

 

So one of my problems probably is that the session can't be written.

 

What I've done

To get the system to basically function I've had to add a number of Osc variables to the calling index.php as globals.

 

The $SID is permanently attached to the URLs (as you'd expect with cookies not working.)

 

Login takes me back to the Osc index page but not logged in

 

Add to cart takes me to an empty shopping cart

 

SESSION_FORCE_COOKIE_USE takes me to cookie_usage yet cookies are enabled (works with all the other localhost scripts including a vanilla Osc)

 

Also the cookie created is called PHPSESSID not osCid

 

If it helps the urls look like ...

 

http://localhost/index.php?option=msb_shop&ref=product_info&cPath=1_4&products_id=1

 

Any pointers gratefully received as this has taken all weekend :huh:

Posted

I think it's nearly sorted

 

I now get the error

 

Warning: session_start(): open(/tmp\sess_3ae2e0fd8e505c2f347e1215ffa3e2b9, O_RDWR) failed: No such file or directory (2) in C:\Program Files\Apache Group\Apache2\htdocs\shop\includes\functions\sessions.php on line 68

 

when going to the site (all pages)

 

So it looks like now the session just can't find a path to write.

 

Info: globals patch applied and all $HTTP_?_VARS are $_GET etc.

 

Any ideas? Perhaps the globals patch is trying to convert an old $HTTP_?_VARS that is already converted.

Posted

Ok I can now log in.

 

The login was failing until I added the following globals to application_top ..

 

global $customer_id, $customer_default_address_id, $customer_first_name, $customer_country_id, $customer_zone_id;

 

 

The cart still says it's empty even though the db has cart entries.

 

$_SESSION contains the following ..

 

Session = Array ( [cart] => [language] => [languages_id] => [currency] => [navigation] => [customer_id] => 2 [customer_default_address_id] => 2 [customer_first_name] => Rob [customer_country_id] => 222 [customer_zone_id] => 0 )

 

any ideas where this is going wrong?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...