I use user IP to find his location for displaying the correct content in my ASP.NET website. I set a session at the start of my default.aspx page to detect whether it is the first time my user runs website or not, if it is the first time, my location detection algorithm runs and city session is set as well. My users can change city and each time they change city, the city session is changed also. This process works fine, but when user closes his browser, and again opens browser my city detection algorithm doesn’t run because my session["firsttime"] is still active and its value is TRUE (my session lifetime is set to its default 20 minutes). How can I detect that user has just started his browser even if he has a session["firsttime"] set to TRUE?
Can I do it using global.asax file?
Try using cookies instead of Session to detect the “first time” & “returning user”. Also, you can set the Location Info in cookie.