Solved

session id / anonymous id to save shopping cart

Posted on 2010-11-09
5
907 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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