Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
deal all

i am working on e commerce website is there any way to find returning visitor


i use following code but not work. when multiple user connected with wifi it only tell public

C#
ipaddressVal = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

        if (!string.IsNullOrEmpty(ipaddressVal))
        {
            string[] ipRange = ipaddressVal.Split(',');
            int le = ipRange.Length - 1;
            ipaddressVal = ipRange[le];
        }
        else
            ipaddressVal = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
Posted
Comments
ZurdoDev 4-Jan-16 11:39am    
You can store a cookie on their machine or use localStorage.

1 solution

This is normally done via cookies, store a GUID or some other non-guessable identifier in a cookie and link it with the user's account. It's still not 100% though as it only identifies people returning to your site from the same computer, but it's probably the best solution you're going to get.
 
Share this answer
 
Comments
Asutosha 4-Jan-16 11:45am    
Please check below link
http://stackoverflow.com/questions/9357982/recognizing-a-returning-visitor-in-asp-net


For anonymous user the only way is the cookie.

You place an encrypted ID to the cookie and connect that id with your anonymous user on the database.

Google set up advertising cookies to last for 30 days for example

http://www.google.com/privacy/ads/

Google analytic set up up to 2 years

http://code.google.com/apis/analytics/docs/concepts/gaConceptsCookies.html

Google Analytics sets an expiration date of 2 years for unique visitor tracking. However, if your visitors delete their cookies and revisit your site, then Google Analytics will set new cookies (including new unique visitor cookies) for those visitors. While you can configure the duration of a user session cookie (from the default 30 minutes) using the _setSessionCookieTimeout() method, you cannot configure the duration of the unique visitor cookie

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900