Click here to Skip to main content
15,392,442 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

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];
            ipaddressVal = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
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.
Asutosha 4-Jan-16 11:45am
Please check below link

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

Google analytic set up up to 2 years

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