Tools, FAQ, Tutorials:
Single Cookie Size Limit in PHP
How Large Can a Single Cookie Be in PHP?
✍: FYIcenter.com
How large can a single cookie be? The answer is depending what is the Web browser your visitor is using. Each browser has its own limit:
If you want to test this limit, copy this sample script, huge_cookies.php, to your Web server:
<?php if (isset($_COOKIE["HomeSite"])) { $value = $_COOKIE["HomeSite"]; } else { $value = ""; } $value .= "http://dev.FYICenter.com/faq/php"; setcookie("HomeSite", $value); print("<pre>\n"); print("Large cookie set with ".strlen($value)." characters.\n"); print("</pre>\n"); ?>
Open your browser to this page for first time, you will see:
Large cookie set with 32 characters.
Click the refresh button, you will see:
Large cookie set with 64 characters.
Keep clicking the refresh button, you will see the limit of your browser.
Â
⇒Understanding and Managing Cookies in PHP
⇒⇒PHP Tutorials
2016-10-30, 1144👍, 0💬
Popular Posts:
How To Control Horizontal Alignment in Table Cells? By default, text in all table cells are aligned ...
How to use urllib.parse.urlencode() function to encode HTTP POST data? My form data has special char...
How to login to Azure API Management Publisher Portal 2017 version? If you have given access permiss...
How to use the JSON to XML Conversion Tool at utilities-online.info? If you want to try the JSON to ...
Where to find tutorials on how to work with MySQL Database in PHP? A collection of tutorials to answ...