473,503 Members | 10,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cookie check and redirect

Our client has asked that we things up so that the user must fill out
a short form with some basic information if they want to access a
number of PDFs on their website, once per session (please don't ask me
why). Submitting the form sets a session cookie.

Specifically, if the user clicks on "example.pdf," I'd like to have
one of two things happen:

1) If the session cookie is set, the PDF is accessed transparently.

2) If the session cookie is not set, the user is sent to the info
form, and on submission is either (a) passed through to the PDF they
clicked the link for, or (b)at least is sent back to the original page
where the link resides so they can select it again. My initial thought
for the latter case was to have the form open in a new window, then
have a close button on the subsequent confirmation page so the
original page is still open in the background.

My apologies if this seems a clunky way of doing things; my experience
with javascript is fairly limited. Any help would be appreciated.

May 14 '07 #1
3 1966
wrote on 14 mei 2007 in comp.lang.javascript:
Our client has asked that we things up so that the user must fill out
a short form with some basic information if they want to access a
number of PDFs on their website, once per session (please don't ask me
why). Submitting the form sets a session cookie.

Specifically, if the user clicks on "example.pdf," I'd like to have
one of two things happen:

1) If the session cookie is set, the PDF is accessed transparently.

2) If the session cookie is not set, the user is sent to the info
form, and on submission is either (a) passed through to the PDF they
clicked the link for, or (b)at least is sent back to the original page
where the link resides so they can select it again. My initial thought
for the latter case was to have the form open in a new window, then
have a close button on the subsequent confirmation page so the
original page is still open in the background.

My apologies if this seems a clunky way of doing things; my experience
with javascript is fairly limited. Any help would be appreciated.
It seems to me you expect this NG to be a free programming service?

You could be right, but I doubt it.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 14 '07 #2
On May 14, 3:32 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
wrote on 14 mei 2007 in comp.lang.javascript:

It seems to me you expect this NG to be a free programming service?

You could be right, but I doubt it.
A pointer in the right direction doesn't seem unreasonable to ask for,
though I could be mistaken.

Then again, as I haven't had the need to check this newsgroup before,
I may have misjudged the level of help available here; my apologies.

May 14 '07 #3
wrote on 14 mei 2007 in comp.lang.javascript:
On May 14, 3:32 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
> wrote on 14 mei 2007 in comp.lang.javascript:

It seems to me you expect this NG to be a free programming service?

You could be right, but I doubt it.

A pointer in the right direction doesn't seem unreasonable to ask for,
though I could be mistaken.

Then again, as I haven't had the need to check this newsgroup before,
I may have misjudged the level of help available here; my apologies.
You should perhaps apologise to yourself, as you seem to thinkg you did
something against the NG.

A pointer is simple, learn some javascript, read the NG faq and try some
code. Tell us where you go wrong.

comp.lang.javascript FAQ - http://jibbering.com/faq/index.html

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 14 '07 #4

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

Similar topics

4
2626
by: Geoff May | last post by:
I'm busy rewriting by F1 database and I want to use cookies to store various user definable views, (basically so that when the visitor returns to a specific page, that page will redisplay in the...
2
9158
by: bagsmode | last post by:
Hi, I'm trying to set a session cookie and then redirect, however I get the error: Status: 302 Moved Location: /index.cgi I thought I recall getting an error like this when I first tried...
8
1561
by: krisrajz | last post by:
Please observe the pages below: session1.asp <% Session("test")="TESTING" Response.Redirect "session2.asp" %> session2.asp
0
1547
by: vMike | last post by:
I don't know if I can explain this here, but I will try. I am using WebRequest/WebResponse to get product information from another website then put the selections in a shopping cart of the remote...
0
2143
by: Bill Borg | last post by:
Hello all, Not sure I can describe this adequately, but I am creating an endless loop when an authenticated user signs out. When the user signs out, I want to remove authentication, abandon...
0
1280
by: briand | last post by:
I have the following code in my base page to redirect to a session timeout page. override protected void OnInit(EventArgs e) { base.OnInit(e); //It appears from testing that the Request...
2
2552
by: Shawn Berg | last post by:
Some of my pages in the app I am developing inherit from a BasePage class I have created. I have done plenty of these in the past and they work fine. Now, however, I have an additional requirement....
1
1589
by: .NET Developer | last post by:
I'm having an issue that hopefully someone here can help me out with. First a quick explanation: I'm managing users of my site in a fairly custom way. (in other words I'm not using asp.net's...
1
4451
by: Joe | last post by:
In ASP.NET 1.1 I could detected expired form authentication tickets (which closely coincide with my expired session) by checking for the Authentication Cookie when the login screen loads. If the...
1
8917
Markus
by: Markus | last post by:
In the process of making a user registration page, and if a username and or email address is already in use i set a cookie then use header( ... to redirect the user back to the page with the form....
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7361
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...
1
7015
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...
0
7470
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...
0
5602
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,...
0
1523
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 ...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.