473,657 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7908
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.javas cript 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_******** ************@gi ganews.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...th ere 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.h tml" 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.h tml" 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.javas cript 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_******** ************@gi ganews.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="saveCo okie(this.href) "

And then save the href in a cookie.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript 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.javas cript:
DGS said the following on 5/16/2007 9:10 PM:
>"Randy Webb" <Hi************ @aol.comwrote in message
news:g_******* *************@g iganews.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...usin g links. However there are a variety of customers and
methods in which the URLS are requested.

Add an onclick to all the links:

onclick="saveCo okie(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='jscri pt' runat='server'>
if (session('logge din') != 'yes') {
session('urlToR eturnToAfterLog in') = request.Serverv ariables('URL') ;
response.Redire ct('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
5590
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 should ask on another group, please let me know. Thanks in advance, Mike.
1
4320
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. I also placed two buttons on the form. One submits the form to redirect to the Crystal Web Viewer (genCREGReports.ASP). The other one executes VB code in a vbs document that spawns some more code to run a stored procedure with the values from...
3
6943
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 ChildForm(); this.AddOwnedForm (child);
4
6224
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 the server to a file. Any ideas would be appreciated. Thank you Paul
9
7854
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 traffic. It then captures or copies all the traffic and simalteanously send it out of port 4321. Another possible example: telnet sends info out on port 23. I want that information captured and sent out in real-time (or almost) of port 80. And...
3
5754
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 http://myserver.com/application/some.asp?form=y&format=mgs&customerid=893bdgt0248991 I want to be able to redirect to an SSL connection httpS://myserver.com/application/some.asp?form=y&format=mgs&customerid=893bdgt0248991
1
2311
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 should not exists in the IIS because I want a custom redirect right. I write a custom HttpModule to capture the HttpRequest but during debug it doesn't go HttpModule code rather a Page not found was thrown by IIS. I want to capture the request first...
4
8727
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 redirect, just uncertain of capturing the URL. TIA ../JLK
5
7167
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 variable or something. I know how to start it , but not how to capture it. Nslookup I realize can be started interactively, which is to some degree what I may need to do as I am discovering that there is no easy way to query DNS svr records with...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.