PDA

View Full Version : Cookie question


dabbler
05-21-2003, 06:04 AM
I wonder if someone could advise on this problem:

I have a site and want to password protect part of it. I want to do this with a cookie and a bit of javascript.

I have a flash movie which can test for a password (sequence of numbers) and then I can use javascript within the movie to set the cookie. (I think)
Then I could use js to test for the existence of the cookie on the password-protected pages, with a redirect to the password movie page if it is not found.

Question is: how?

I have a script for cookie redirection, but I really don't know enough about js to figure it out yet. My host doesn't have php so I can't use that on this site (even if I knew how!!!!)

Can someone post a simple script that will set the cookie?
And then how to check for it?

Thanks

DCElliott
05-22-2003, 07:09 PM
Here is one of the first hits from the Google seach on: javascript set cookie

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20166700.html
It looks like it might be the ticket.

DE

dabbler
05-27-2003, 02:12 PM
Thanks for that DE.

I got all sorts of Javascript sites bookmarked for scripts etc. and never thought to try Google!

It actually wasn't quite what I wanted, but I was able to study it and dissect it and take something I could use. I learned a lot in the process!

Thanks once more.