A programmer's paradise created by the twist of deliberated fantasies, and actions of a determined imagination.
Follow ME:
www.linkedin.com
...
Cheap and affordable: Cloud Webhosting for only Php.500.00 monthly. Unlimited webspace and Bandwidth. Contact ME at tuso@programmerspride.com to avail a service.

Add to Google
Verification Code
Verification Code / Security Code or similar to the CAPTCHA Project. With PHP GD Library, you can create a verification code to verify access o ...

Limiting a Cookie's availability on specific directories

Platform: XAMPP in windows' Localhost (127.0.0.1).
Limiting a Cookie's availability on specific directories.

If you want to set a cookie which is only accessible to a specific directory then
you cannot just write the example code shown below:
setcookie('mydir_cookie_only', 'Acess OK', time() + 3600, '/mydir/');
Do this instead:
setcookie('mydir_cookie_only', 'Acess OK');
setcookie('mydir_cookie_only', 'Acess OK', time() + 3600);
setcookie('mydir_cookie_only', 'Acess OK', time() + 3600, '/mydir/');
You need to extract the code and call it inside that directory. In our example, the directory is named mydir. So the code should be written in a PHP script inside mydir before executing it. If you fail to execute the code inside mydir then even in the presence of the path specification, the Cookie variable will be still accessible outside the specified directory.