note 43449 modified in function.base64-encode by aidan
| From: | aidan@php.net | Date: | Thu, 26 Aug 2004 11:10:12 +0000 |
| Subject: | note 43449 modified in function.base64-encode by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75321@lists.php.net to get a copy of this message | ||
If you use base64encoded strings as cookie names, make sure you remove '=' characters. At
least Internet Explorer refuses cookie names containing '=' characters or urlencoded
cookie names containing %xx character replacements. Use the function below to turn base64 encoded
strings to bare alphabets (get rid of / and + characters as well)
<?php
function base64clean($base64string)
{
$base64string =
str_replace(array('=','+','/'),'',$base64string);
return $base64string;
}
?>
--was--
If you use base64encoded strings as cookie names, make sure you remove '=' characters. At
least Internet Explorer refuses cookie names containing '=' characters or urlencoded
cookie names containing %xx character replacements. Use the function below to turn base64 encoded
strings to bare alphabets (get rid of / and + characters as well)
<?php
function base64clean($base64string)
{
$base64string=str_replace('=','',$base64string);
$base64string=str_replace('+','',$base64string);
$base64string=str_replace('/','',$base64string);
return $base64string;
}
?>
http://php.net/manual/en/function.base64-encode.php