I have developed a cookie based age verification wrapper for my forums. Problem is it locks anyone and everyone out of the forum until they generate a cookie - i.e. no search engine or unregistered browsing!
I would like to check for the existnece of the cookies only on the registration page. Is this possible?
Currently
- I'm checking for an age verification cookie at top of the 'index.template.php' page (global detection)
- If none exists they go to 'Age.php' page which on submission sets the Pass or Fail cookies
- Pass cookie = access to forums
- Fail cookie = redirect to Sorry.php page
I would like to
- Check for the Pass/Fail cookies only at this URL location: 'index.php?action=register'
- Allow search engines and unregistered visitors to browse the site without existence of the Pass/Fail cookies
So you want to registration page to search for a planted cookie?
A cookie on registration is what I ended up with when I couldn't find an existing age verification module.
I finished it up last night once I figured things out (white space, header and domain declaration issues which originally led me to believe 'Register.php' was not the page I needed to affect).
Any visitor to here is checked for the existence of an age verification cookie: /index.php?action=register
- Positive cookie presents the registration module
- Negative cookie redirects to "sorry" page with site terms
- No cookie redirects to age verification form which sets either of the above cookies. Positive cookie for 30 years, negative cookie for 30 days.
I wrapped the Cookie detection and redirect code around this file: /sources/Register.php