How would I be able to disallow access to all the pages within my site, unless a cookie is present? Without modifying all the files in order to check if the cookie is active. At a loss on how to go about this.
If you have header/constant/functions or some other file included in every page/files then you can write a piece of code to check for cookie <?php if (isset($_COOKIE["cookie_name"])) echo "Welcome to our site"; else echo "go away"; ?> PHP:
Yeah, I don't have that but I figured out how to do it via .htaccess. RewriteEngine On RewriteBase / RewriteCond %{HTTP_COOKIE} !^.*cookie-name.*$ RewriteRule .* /redirectionpage.html [NC,L] Code (markup): For anyone that needs it.
This isn't a very secure way of restricting access. A cookie can be easily forged which would give someone access to this area when they shouldn't. If there is anything sensitive in the area you're protecting, I would opt for another method.
It's nothing sensitive, it's just mainly them having to click continue on the splash page before being able to access any other pages.