Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2004, 06:44 PM
Registered User
 
Join Date: Feb 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default remembering last login webpage.

I am creating a registered users only site using MS ACCESSS database. When a registered-user logs out, how would I 'bookmark' it such that it will remember the last web page that he logged out at? Then, when he logs back in, i want him to be on the same web page where he last log out.



 
Old February 8th, 2004, 08:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you are using either the SESSION or APPLICATION objects, then you could use their ON END functionality to trap this, alternatively you could set a cookie on the client side every time a page is unloaded using the ONUNLOAD function.
 
Old February 9th, 2004, 11:44 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
webpage login using .htaccess control allang Pro JSP 0 May 1st, 2005 08:08 PM
login failed for user nt authority\anonymous login rj1406 Classic ASP Databases 1 October 24th, 2004 09:15 AM
Remembering URL fs22 Javascript 2 April 7th, 2004 07:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.