Using the session and application objects would limit you to the session timeout limit and the lifespan of the application (reset when IIS is cycled or the machine is rebooted). If you want to save the information indefinately and not have it tied to a user session, I would recommend saving the current page to their user data in the DB when they log out. Of course this will only work if they actually log out. You could save the current page on every page hit, so that if they log out or just close the browser you'll have the current page already saved. Then when they return and log in, you can look up that value and redirect them to that last page. You'll have to make your logic that saves the current page only save the page location if the user if logged in so the return hit to the login page doesn't get logged. (You probably wouldn't even want to bother to log it anyway as that wouldn't be a logical place to return to once they are logged in.)
Peter
------------------------------------------------------
Work smarter, not harder.
|