The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Cookie help, restrict access without it.
sharf
post Sep 1 2009, 07:02 PM
Post #1





Group: Members
Posts: 1
Joined: 1-September 09
Member No.: 9,652



Ok so I have a website. I want it so that if you don't have a certain cookie, all the pages redirect to a page that requires you to agree to the terms, or else you can't do anything. So far, I have that page set up, and you have to click accept to go to the next page via this code:
<form id="form1" name="form1" method="post" action="index.html" ><label>
<input type="submit" name="button" id="button" value="I accept" />
</label>
</form>

What I need basically is when you hit accept, it creates a cookie saying you agreed. Then I need a way for each page to validate the cookie so it will allow access. I plan on adding a log in system eventually, but not yet. I was thinking I could do that to get around this, but I'd like guests to be able to view it regardless of registration. Is there also a way to say the cookie doesn't matter as long as the user is logged in? (future reference).

In short, I need to create a cookie when you press a button, and if that cookie exists, allow access to all pages, but restrict access(by redirecting the page) if the cookie doesn't have the right info.

I have Dreamweaver CS4 and I have yet to find an easy cookie setting, I've looked through the spry stuff and have had no luck.

Any help is appreciated, thanks.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 17th April 2024 - 09:50 PM