
November 30th, 2012, 01:38 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 11
Time spent in forums: 3 h 3 m 45 sec
Reputation Power: 0
|
|
|
PHP5 - Session ID changes
I am writing a bespoke shopping cart and using php session_id() to track an order before the customer either logs in or creates an account. The idea is that it uses the session id to uniquely identify a person while they are browsing and adding products to the basket, then when they sign in it uses their generated user ID in place of the session ID
My problem is, that as you order the first product, irrespective of what it is, the session ID changes. After than, no matter what you order, it stays the same, so should you order 20 products, the last 19 are the same session id, but the first is completely different. When you come to the checkout, the shopping basket is now missing the first product ordered.
I have the session start command at the very top of each page, and session.auto_start is set to 1 in the php.ini file. There are NO characters before I start the session is started.
Any ideas before I re-write the software?
|