473,322 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

URL capture and redirect

DGS
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.
May 17 '07 #1
4 7889
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?
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/
May 17 '07 #2
DGS

"Randy Webb" <Hi************@aol.comwrote in message
news:g_********************@giganews.com...
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.
>
>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.
>
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/

May 17 '07 #3
DGS said the following on 5/16/2007 9:10 PM:
"Randy Webb" <Hi************@aol.comwrote in message
news:g_********************@giganews.com...
>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.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 17 '07 #4
Randy Webb wrote on 17 mei 2007 in comp.lang.javascript:
DGS said the following on 5/16/2007 9:10 PM:
>"Randy Webb" <Hi************@aol.comwrote in message
news:g_********************@giganews.com...
>>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)
May 17 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mike - EMAIL IGNORED | last post by:
I have a VC++6.0 program than calls library functions that write to cerr. I would like to capture this output in the calling program. Would you please let me know how I could to this? If I...
1
by: Jim Quast | last post by:
I have an ASP page and a CREGReports002.vbs file coded to export data to excel. I do this by building variables in a stored procedure. The ASP page has text boxes, list boxes, and radio buttons. ...
3
by: Frank T. Clark | last post by:
How do I redirect or capture keydown events in a parent form from a child form? I have a main form which displays another informational form marked "SizableToolWindow". Form child = new...
4
by: Paul | last post by:
I have developed an ASP.NET web page with a VB.net for the code behind. I would like to redirect the output of the web page so I can send it as an Email. Or Redirect the HTTPResponse stream on...
9
by: Hugh Janus | last post by:
Hi all, Does anybody know if it is possible with VB.NET to capture and redirect traffic that flows through a particular port? i.e. the app either listens or watches port 1234 for outgoing...
3
by: Nuevo | last post by:
I am looking for some method to capture, into a variable, the entire URL of an http request and redirect to SSL. For example, if a user opens a browser and typed in ...
1
by: Jeck621 | last post by:
I like to create a custom code to make custom redirect. For example, I like this URL to be the redirect URL http://testme.now/test to be redirected to http://nowtesting.com. Actuall the /test folder...
4
by: Akhenaten | last post by:
What's the most effective way to capture a URL to pass as a variable? I have a login function I want to modify to redirect the user back to the page they logged in from. I know how to do the...
5
by: Muffin | last post by:
I am trying to capture the out put of a command line program. Let say ping or maybe better yet nslookup. I would like to launch and then capture all the output , redirect it I guess to a string...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.