Stefan Fachmann
Stefan Fachmann

Reputation: 545

ASP.NET, closing browser window

Suppose I have an ASP.NET registration wizard. The collected information for each step is temporary stored in a database table, when clicking “Next”. Now suppose the user closed the browser window, or computer was unexpectedly shut down. So in that the application should delete all the temporary registration information. How could it be done?

Additional information: I cannot use cannot use a Session object because the application is served from a webfarm.

I thought already about using a stored procedure for clean up the table. But want to find out other possibilities.

Upvotes: 0

Views: 262

Answers (2)

AD.Net
AD.Net

Reputation: 13399

In such scenario, you can assign a temporary registration id for each session/attempt. If the window is closed, next attempt will be a new one and the application should run a clean up job every night or so to delete incomplete attempts.

Upvotes: 0

walther
walther

Reputation: 13600

Simply do not store into db data that is incomplete. Use a session as a temporary storage instead. It gives you not only a better performance (you avoid db hits), but it avoids problems like yours altogether. Store to database only after all necessary info has been inputted.

Upvotes: 2

Related Questions