Cookie check and redirect


F

fahrenheit

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.
 
Ad

Advertisements

E

Evertjan.

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.
 
F

fahrenheit

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.
 
Ad

Advertisements

E

Evertjan.

wrote on 14 mei 2007 in comp.lang.javascript:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top