How many cookies can you set in your PHP page? The answer is depending what is the Web browser your visitor is using. Each browser has its own limit: Internet Explorere (IE): 20 Mozilla Firefox: 50If you want to test this limit, copy this sample script, how_many_cookies.php, to your Web server:<?php $count = count($_COOKIE); $name = "Cookie_".($count+1); $value = "FYICenter.com"; setcookie($name, $value); print("<pre>\n"); print("One cookies were added.\n"); print("$count cookies received.\n"); foreach ($_COOKIE as $name => $value) { print " $name = $value\n"; } print("</pre>\n"); ?>Open your browser to this page for first time, you will see:One cookies were added.0 cookies received.Click the refresh button, you will see:One cookies were added.1 cookies received. Cookie_1 = FYICenter.comKeep clicking the refresh button, you will see the limit of your browser.
PHP
Topic: Cookies
How Many Cookies Can You Set?
Browse random answers:
How To Send a Cookie to the Browser?
How To Test Cookies on a Web Server?
How To Set a Persistent Cookie?
How To Test Persistent Cookies?
What Are Domain and Path Attributes for Cookies?
How To Specify Domain and Path for a Cookie?
What Is the Common Mistake When Setting Path and Domain on Temporary Cookies?
How Cookies Are Transported from Servers to Browsers?
How To View Cookie Header Lines?
How Cookies Are Transported from Browsers to Servers?
Where Are the Persistent Cookies Stored on Your Computer?
How To Delete Cookie Files on Your Computer?
How Many Cookies Can You Set?
What is a Cookie?
How to Create a Cookie?
What is syntax of setcookie?
How to Retrieve a Cookie Value?
How to Delete a Cookie?
What is the meaning of a Persistent Cookie?
What does $_COOKIE means?