Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3485276
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:53:17+00:00 2026-05-18T10:53:17+00:00

I am displaying a products section where there is an add to cart button.

  • 0
  1. I am displaying a products section where there is an add to cart button.
  2. The user may or may not be logged in.
  3. Instead of maintaining the cart items in session i maintain it in the database with the current session id as reference.
  4. After a few navigation or default session time out the session id is regenerated.
  5. So the current session id does not match with the items added by the user in the database.
  6. So the total items and amount which i display at the top of the page because zero.
  7. I had maintained the cart items in the session in the previous projects so i haven’t had any problems.
  8. I am using code igniter frame work

What should i do to sync the regenerated session id of codeigniter and the session id of the cart items. I am using Native Session in codeigniter rather than the default session management which comes with codeigniter. The reason is the session does not work in IE6 because i hope IE6 is not understanding CI’s headers or some thing like that.

I want to maintain the cart items in database only. What shall i do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:53:18+00:00Added an answer on May 18, 2026 at 10:53 am

    You could use standard PHP sessions – track your own session ID and store that in the DB. Skip the regenerated CI-SessionID entirely.

    http://www.php.net/manual/en/session.examples.basic.php

    Of course, the downside to this is the sessions aren’t stored as cookies in this manner so when a user’s session expires – they lose their basket. But you can work around this yourself with either a manual cookie store, or force the user to register/login to save basket data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As I am not able to add more than 6 products to the cart
In grid mode displaying the products, I would like the Add to cart buttons
I'm making shopping cart, and I have s problem displaying the products. Here's a
I'm displaying a list of products as read off of the RSS feed from
Displaying Type here to ... until the user enters text into a TextBox is
When displaying a confirm box in javascript, there seems to be a delay after
I have a UITableView displaying a set of options from which the user will
I am displaying categories in a dropdown list for adding products. When a product
I have a page where some products and textfields where the user enters a
Just doing some Rails and noticed that when displaying 30 products on a single

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.