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 June 3rd, 2005, 10:04 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Redirecting and Logging off.

Hi,

I need guidance regarding two problems/concepts:
1)Which is the best way to handle log-in and log-out functions in ASP?

2)Further, I have kept one button in asp page, now when user clicks on it, it should send user to the page from which it was accessed, mean to the referrer page.
Coding is in VBScript and ASP.


 
Old June 3rd, 2005, 02:37 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Rupen,

1) Can you explain that in detail on what you are looking for regarding login/logout.

2) You can get that using the following.
Code:
<a href = "<%=Request.ServerVariables("HTTP_REFERER")%>">Click here to go back</a>
_________________________
- Vijay G
Strive for Perfection
 
Old June 6th, 2005, 05:54 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

I am developing timesheet application for our employee, so for entering their time they will log in using their IDs, after entering time they need to log off, meaning that they should not be able to go back (using browser button) and enter time or view reports etc..
In short a tipical login and logoff type application.
For (2)where should i write this code in click event of button?? Please explain it.

Thanks in advance.

 
Old June 6th, 2005, 07:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you are looking for restricting the user from going back after logging off, better use
Code:
onload="javascript:history.go(1)"
in the <Body> tag on the page from where the user logs out. This will not let the user go back once logged out. This has to be given on all pages from where logoff is provided.

Also use session variable and check on all pages if the session variable contains value, carry this out till the user signs off. Once the user signs out, Use
Code:
Session.Abandon()
that clears the session variables and thus if the user is still able to go back, then automatically he wouldn't be able to access the pages, as the session is abandoned. You got to be careful to check the session values on all pages, which fall under log on session for the user, and redirect the user to a customized error page, if the session is invalid.
Hope that helps.

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
URL Redirecting ashbmpg Apache Tomcat 0 September 15th, 2006 03:57 AM
Page Redirecting venkatagiri ASP.NET 2.0 Basics 0 June 22nd, 2006 06:17 AM
SSIS - Built-In Logging / Custom Logging ivobecker23 SQL Server 2005 0 April 21st, 2006 05:41 AM
Redirecting eldanh ASP.NET 1.0 and 1.1 Basics 3 August 9th, 2004 09:02 AM
Redirecting kend Classic ASP Basics 2 July 8th, 2003 04:15 AM





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