Connecting Tech Pros Worldwide Help | Site Map

URL capture and redirect

  #1  
Old May 17th, 2007, 01:35 AM
DGS
Guest
 
Posts: n/a
Hi guys,

Not a developer, but an admin so please pardon my ignorance.

I have an issue that I was hoping to get help with. What I need is for the
front page of my site to capture the URL that the user is requesting.
Regardless of where they go, they are prompted to login...but I want the
initial login page to capture where they have REQUESTED to go and store it
somewhere (I assume a cookie).

Then...later on in the process they will hit a redirect page which will read
that cookie value and send them to the originally requested page.

The reason for all of this is that the current redirection we are using
works fine, only it uses the "referrer" header and if the user is sent to a
"password change" or "incorrect password" screen then the referrer header
changes and becomes useless once the user goes to the latter redirect.html
page.

Any help is GREATLY appreciated.


  #2  
Old May 17th, 2007, 01:55 AM
Randy Webb
Guest
 
Posts: n/a

re: URL capture and redirect


DGS said the following on 5/16/2007 8:25 PM:
Quote:
Hi guys,
>
Not a developer, but an admin so please pardon my ignorance.
>
I have an issue that I was hoping to get help with. What I need is for the
front page of my site to capture the URL that the user is requesting.
How is the URL being requested? From links, buttons, or otherwise?
Quote:
Regardless of where they go, they are prompted to login...but I want the
initial login page to capture where they have REQUESTED to go and store it
somewhere (I assume a cookie).
Then why not require the login *before* a page is requested? Make the
main page a login page. They login, they get a page of links. Then have
each page check to see if they logged in. If they didn't, then redirect
to the login page. The login page will have a hidden field containing
the URL that is in the referrer. Then everytime they submit the form it
keeps populating that hidden field until they successfully login. Then
the server reads that hidden field and redirects to the requested page.
No JS needed.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
  #3  
Old May 17th, 2007, 02:15 AM
DGS
Guest
 
Posts: n/a

re: URL capture and redirect



"Randy Webb" <HikksNotAtHome@aol.comwrote in message
news:g_2dnXn3pdqeO9bb4p2dnA@giganews.com...
Quote:
DGS said the following on 5/16/2007 8:25 PM:
Quote:
>Hi guys,
>>
>Not a developer, but an admin so please pardon my ignorance.
>>
>I have an issue that I was hoping to get help with. What I need is for
>the front page of my site to capture the URL that the user is requesting.
>
How is the URL being requested? From links, buttons, or otherwise?
The URL is most frequently accessed from various customer's intranet
pages...using links. However there are a variety of customers and methods
in which the URLS are requested.
Quote:
>
Quote:
>Regardless of where they go, they are prompted to login...but I want the
>initial login page to capture where they have REQUESTED to go and store
>it somewhere (I assume a cookie).
>
Then why not require the login *before* a page is requested? Make the main
page a login page. They login, they get a page of links. Then have each
page check to see if they logged in. If they didn't, then redirect to the
login page. The login page will have a hidden field containing the URL
that is in the referrer. Then everytime they submit the form it keeps
populating that hidden field until they successfully login. Then the
server reads that hidden field and redirects to the requested page. No JS
needed.
The product in use here is Tivoli's WebSEAL...which is a reverse proxy
webserver with security. Because of the wide variety of URLs the customer
is using creating a landing page with links would be impossible...there are
simply too many of them. Basically, WebSEAL looks at the URL requested and
if authentication is required, stores it away (encrypted in a session cookie
where I have no ability to cull out the data). If the user's authentication
is succesful they go to a "redirect.html" page local on the WebSEAL server
(I could go into why but that is a long story in and of itself...due to SSO
reasons). Everything works fine, but the "redirect.html" page uses the
referrer header which, if the user was forced to change their password due
to expiration, is no longer populated with the originally requested URL.
Quote:
>
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/

  #4  
Old May 17th, 2007, 02:45 AM
Randy Webb
Guest
 
Posts: n/a

re: URL capture and redirect


DGS said the following on 5/16/2007 9:10 PM:
Quote:
"Randy Webb" <HikksNotAtHome@aol.comwrote in message
news:g_2dnXn3pdqeO9bb4p2dnA@giganews.com...
Quote:
>DGS said the following on 5/16/2007 8:25 PM:
Quote:
>>Hi guys,
>>>
>>Not a developer, but an admin so please pardon my ignorance.
>>>
>>I have an issue that I was hoping to get help with. What I need is for
>>the front page of my site to capture the URL that the user is requesting.
>How is the URL being requested? From links, buttons, or otherwise?
>
The URL is most frequently accessed from various customer's intranet
pages...using links. However there are a variety of customers and methods
in which the URLS are requested.
Add an onclick to all the links:

onclick="saveCookie(this.href)"

And then save the href in a cookie.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
  #5  
Old May 17th, 2007, 09:45 AM
Evertjan.
Guest
 
Posts: n/a

re: URL capture and redirect


Randy Webb wrote on 17 mei 2007 in comp.lang.javascript:
Quote:
DGS said the following on 5/16/2007 9:10 PM:
Quote:
>"Randy Webb" <HikksNotAtHome@aol.comwrote in message
>news:g_2dnXn3pdqeO9bb4p2dnA@giganews.com...
Quote:
>>DGS said the following on 5/16/2007 8:25 PM:
>>>Hi guys,
>>>>
>>>Not a developer, but an admin so please pardon my ignorance.
>>>>
>>>I have an issue that I was hoping to get help with. What I need is
>>>for the front page of my site to capture the URL that the user is
>>>requesting.
>>How is the URL being requested? From links, buttons, or otherwise?
>>
>The URL is most frequently accessed from various customer's intranet
>pages...using links. However there are a variety of customers and
>methods in which the URLS are requested.
>
Add an onclick to all the links:
>
onclick="saveCookie(this.href)"
>
And then save the href in a cookie.
Good idea, Randy, but it would fail, if the user has multiple sessions in
different windows of the same browser type, as cookies do not natively
know about sessions.

I think we should advice the OP to use serverside sessions and scripting,
also while his stipulation of a login already hopefully implies having
serverside technology available.

asp jscript:

<script language='jscript' runat='server'>
if (session('loggedin') != 'yes') {
session('urlToReturnToAfterLogin') = request.Servervariables('URL');
response.Redirect('login.asp');
}
</script>

Using an include for this makes life even easier.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture HTTP Request before IIS Jeck621 answers 1 February 10th, 2007 04:52 AM
Using ASP to capture a query string and redirect to SSL Nuevo answers 3 July 21st, 2006 02:45 PM
Get requsted url? Mark answers 3 November 18th, 2005 03:26 PM
Alternate Methods of getting last URL client visited? Help Drifter answers 4 July 19th, 2005 09:42 AM