If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > redirect from login page

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-05, 02:27
bono56 bono56 is offline
Registered User
 
Join Date: May 2004
Posts: 133
redirect from login page

hi
in my website when a user click on a link that require permission (guest users cant see that page), user redirect to login page. & after login user goes to index page again, but i want user redirect to page that user clicked on it.

i have an include file on every page (chkpermission.inc) that checks user logged in or not, & if not redirect to login.asp .
in addition, i wonder why request.ServerVariables("HTTP_REFERER") doesnt work right in this case.

for example i have this inc file on page2.asp. when user click on this page link from index.asp guest user first go to page2.asp & after that redirect to login.asp. but request.ServerVariables("HTTP_REFERER") return "index.asp".

Last edited by bono56; 03-05-05 at 02:30. Reason: edit
Reply With Quote
  #2 (permalink)  
Old 03-06-05, 17:13
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Hmmm,.. that's a bit weird... I do know that not all browsers will support http referer and some firewalls block that information, but in that case I wouldn't have even expected you to get index.asp so.....
Reply With Quote
  #3 (permalink)  
Old 03-09-05, 09:19
plsh plsh is offline
Registered User
 
Join Date: Nov 2004
Posts: 253
Not an ideal solution but what about using a session variable. At the start of the page you can set the session variable to the page name, something like:
Session("sPage") = "index.asp"

Then when your code sees that the user is not logged in and redirects them to the login page you can direct them back to the page that is staored in the session variable. I know this is not ideal, but just a thought for now perhaps??
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On