Solved

session id / anonymous id to save shopping cart

Posted on 2010-11-09
5
902 Views
Last Modified: 2012-06-27
I want to be able to save the shoppping cart even whether the user is logged in to the website or not. how can I associate the shopping cart to the user when the user is not logged in.

If I use the session ID can I still acess the same session ID, even if the user closes there browser and re-opens after a few days?

Should I be using the anonymous ID for this purpose instead of session ID. Thank
0
Comment
Question by:TrialUser
  • 2
  • 2
5 Comments
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 167 total points
ID: 34093025
I would use something like the client's IP address to use as the "anonymous ID" for the user.  You can get it with this:

HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

Then, save this out in a Cookie.  Sessions won't last but Cookies will.

0
 
LVL 18

Assisted Solution

by:Richard Lee
Richard Lee earned 333 total points
ID: 34094018
Simply save the shopping cart details in a cookie if the user is not logged in and to make the user really happy, merge the contents of the cookie with their existing basket contents after offering them the option.

DaTribe
0
 

Assisted Solution

by:TrialUser
TrialUser earned 0 total points
ID: 34094259
Ok, instead of writin g to a cookie can I write into the database? I am wondering if we can loose the information stored in the cookie based on the users browser settings. Thanks
0
 
LVL 18

Assisted Solution

by:Richard Lee
Richard Lee earned 333 total points
ID: 34094370
No doubt you can lose the information in a cookie based on the user settings and also if they love clearing their cookies. The database would be a great solution - like what amazon does.

DaTribe
0
 

Author Closing Comment

by:TrialUser
ID: 34143320
thx
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question