c# - How do I identify a user returning to my ASP.NET MVC site from elsewhere? -
how can determine if user hitting site elsewhere (i.e. new tab or site)? need present 'welcome back' message returning users still logged in, don't want appearing if they're navigating within site or, say, reloading homepage.
i've considered using onload/onbeforeunload
(or similar) keep track of whether there view open, adds complexity.
can assume if request.urlreferrer
doesn't contain domain it's 'fresh' visit?
try this,
if(request.urlreferrer != null && request.urlreferrer.host != request.url.host) { // user visit page site/domain }
Comments
Post a Comment