Quote:
Originally Posted by JEFFPINCT
This is important & I need an answer soon!
I have a linux hosted website. I need to be able to check existing users for a cookie or deny access completely. Also I need each placed cookie to expire 12 hrs after creation.
How do I do this the easiest way? Please be gentle - I am very NEW at this....
|
I would not recommend any cookie authentication for any sensitive data. Cookie authentication can be easily bybassed and even your cookies can be stolen easily.
But here is simple example for PHP:
<?php
if(!isset($_COOKIE['mycookie']))
{
echo "<center><font color='666666'>No auth because no valid cookie found!</font></center>";
exit(0);
}
?>
Script expect user to have cookie set named: mycookie
Not set, no access