Use setrawcookie() instead of setcookie() to avoid percent-encoding