Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

session id / anonymous id to save shopping cart

Posted on 2010-11-09
5
Medium Priority
?
949 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 668 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 1332 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 1332 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

688 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