How would you count a user's accumulated visits to your site client-side?
问题 I want to keep track how many times a user has visited my site/domain. For example, say I wanted to display a message to the user after their 10th visit to the site. Each pageload should not count as a new visit. A visit in this case is more like a session. Browse all you want in one sitting, that's one visit. Close your browser and come back, that's a second visit. I thought it would be good to do this by utilizing localStorage and sessionStorage. I put a value in sessionStorage to show that