I have a basic cookie that is incorrectly encoding (or incorrectly decoding) the URL characters.
The cookie will set, however the value isn't encoding properly. Cookie value needs to be: https://mywebsite.com, however once I set the cookie, it displays the value as: https%3A%2F%2Fmywebsite.com, so the cookie doesn't work.
All the other variables are working, but I cannot get encoding to write https://
Cookie is in php (wordpress).
Code is:
<?php
//Cookie
$cookie_name = "cookie";
$cookie_value = "https://mywebsite.com";
setcookie($cookie_name, $cookie_value, time() + (86400), "/", ".mywebsite.com", TRUE);
//end cookie
?>
I've tried adding urldecode($cookie_name); and urldecode($cookie_value); but neither works.