Link to home
Start Free TrialLog in
Avatar of BR
BRFlag for Türkiye

asked on

php cookie security

Dear Experts,

I'm having a cookie like this to show a banner only once to the user everyday.
should I use a function like htmlspecialchars for security reasons?
thank you

<?php
if(!isset($_COOKIE['countsss']))
{
        $_COOKIE['countsss'] = 0;
}
$countsss = $_COOKIE['countsss'] + 1;
setcookie('countsss',$countsss,time()+60*60*24); //24 hours
?>
SOLUTION
Avatar of Greg Alexander
Greg Alexander
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Aaron Tomosky
Aaron Tomosky
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BR

ASKER

thank you