View Full Version : Security cookie and cookie checker.

Dec 15th, 2006, 11:33 AM
This is pretty hard what I'm about to ask...

But, bear with me...


I am using a javascript password protection script to allow users access into my website, the script checks a .js file on the index page for the user names and passwords and see if they match to allow access, if the name and pass are correct and are there the script allows the user to be directed to the homepage of the site, if the name and pass are incorrect or do not exist the script doesn't redirect them into the page. I have the end of the code in the .js file here:

// Your other commands here
}window.location = "http://www.toxicseduction.com/home.htm"; [This is what happens when the name and pass are correct]

I am looking for a command to add above the redirect command that will leave a cookie for the users who have the correct name and pass.

After the cookie is left they will be redirected instantly,

but now I want a script for the homepage that the registered users were redirected to that will check to see if the cookie is there, and if it isn't they won't be able to see the content on the page.

Does anyone know what I need to do this?

Note: I will be encrypting the index page so that guests don't see the location of the .js file in the source and i will also be having the cookie placed on another site but loaded from my main site so that it's not saved when users choose to save my site so they got no idea of getting in.

Can anyone help me here?

Copyright for this question by Jose Contreras 2006.