Link to home
Start Free TrialLog in
Avatar of GorGor1
GorGor1

asked on

checking if cookie exists

I set a cookie with Perl.  Now on each page, I'm going to include a piece of javascript that checks if the cookie exists.  I don't care what information the cookie holds because it doesn't matter.  I just want to know if the cookie exists.  If it doesn't exist, I'm going to redirect to an 'Error' page.  Any ideas?
Avatar of GorGor1
GorGor1

ASKER

when I say 'each page', I mean that I'm going to include a piece of javascript on each HTML page.
if (!document.cookie)
{
  //your re-direction code goes here
}




Cd&
Avatar of GorGor1

ASKER

How does that code know which cookie I'm looking for?
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad I could help.  Thanks for the A. :^)

Cd&