Automatically logs users outside asp.net at close

I recently inherited the asp.net site, consisting of several .aspx and .ascx pages, and was fairly new to web development and especailly asp.net. I have a website that creates a cookie on login to automatically register users if the page doesn’t work when they enter information.

I need the site to automatically register users when the site is closed. Obviously, using the me.close event on each page will not work, because we do not want it to register people every time they go to a new page on the site.

I tried setting timeouts in both IIS and website files for longer, but that doesn't seem to have an effect.

Is there a simple way to automatically register users when they leave the site, but not when they move from page to page.

+1
source share
1 answer

HTTP is a stateless protocol, so there really is no easy way to do this.

If this is an integral part of your service, you can use AJAX ping every 30 seconds, and then if there is no ping for 2 minutes, you can withdraw them.

This is what I did on one of my apps on the site, and it seems to work just fine.

+1
source

All Articles