PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 30th, 2012, 01:38 PM
westie2506 westie2506 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 11 westie2506 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 3 m 45 sec
Reputation Power: 0
Send a message via MSN to westie2506 Send a message via Skype to westie2506
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?

Reply With Quote
  #2  
Old November 30th, 2012, 02:06 PM
NotionCommotion NotionCommotion is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Sep 2006
Posts: 1,518 NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 2 h 21 m 21 sec
Reputation Power: 526
I guess I would search all the script that comes with the bespoke shopping cart for session_id(), session_start(), and maybe other related functions.

Reply With Quote
  #3  
Old November 30th, 2012, 07:00 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Dec 2004
Posts: 8,057 E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 1 Day 5 h 51 m 35 sec
Reputation Power: 7104
Are you changing domains after adding your first product? ie: transitioning from yoursite.com to www.yoursite.com or vice versa
__________________
PHP FAQ
How to program a basic, secure login system using PHP
Connect with me on LinkedIn


Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
  #4  
Old December 1st, 2012, 04:23 AM
westie2506 westie2506 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 11 westie2506 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 3 m 45 sec
Reputation Power: 0
Send a message via MSN to westie2506 Send a message via Skype to westie2506
Quote:
Originally Posted by E-Oreo
Are you changing domains after adding your first product? ie: transitioning from yoursite.com to www.yoursite.com or vice versa


Ahh - thanks. I'd not specified www or http://www or anything like that, just relative pathing until I use the header command in PhP to redirect.

Edited code and now it works.

Thank you.

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP5 - Session ID changes

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap