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 620765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:47:59+00:00 2026-05-13T18:47:59+00:00

How is, for example, a shopping cart cookie set? Once something is added to

  • 0

How is, for example, a shopping cart cookie set?
Once something is added to the cart it “creates” the cookie but how does the next page know to send a new http header with this new cookie to the client?

How is a cookie dynamically set based on user input? Is this functionality dependent on anything else?

I did see this example, but I am missing something.

Any help is appreciated, thanks.

CGI-C

  • 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-13T18:47:59+00:00Added an answer on May 13, 2026 at 6:47 pm

    This is a typical set of steps.

    1. You submit a HTML form to /add_item. You don’t send any Cookie header.
    2. The script at /add_item looks at your HTTP request.
    3. It sees that you did not send a Cookie header with your request.
    4. It creates a session for you. That means a set of variables (e.g. a list of items in your cart) are mapped to a unique identifier for your visit. Sessions really only exist on the server. The cookie is all the browser sees.
    5. It adds the item you added to your session.
    6. It then sends the output of the “Item Added!” page with a Set-Cookie header. That header contains the new session identifier.
    7. You add another item in your cart. This time, you send a Cookie header with the same ID the server gave you before.
    8. The server sees you already have a session ID so it does not create a new session.
    9. It adds the new item to your existing session.
    10. It sends the new “Item Added!” page with the same Set-Cookie header as before.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a really simple e-commerce in my website. It's just a shopping cart,
I've only been working on Magento for a few days but already it is
For example, I am using wenclient.DownloadfileAsync to download a file asynchronously. In the DownloadFileCompleted
I'm getting into MVC and is wonderful, however, still need to decide what dabatase
In Core Data is there a way to have one instance of an object
I feel like I am fighting against the current when I develop ASP.NET Webform
I have taken over development of a website that integrates with Netsuite. The main
Thinking of building a nested category system using chained strings for lack of a
I have multiple tables that I want to join to get a specific result.
Invoice ID, PO Number and dueDate are shown in duplicates. TotalPrice is an alias

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.