Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How Many Cookies Can You Set
How Many Cookies Can You Set? - PHP Script Tips - Understanding and Managing Cookies
✍: FYIcenter.com
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:
If 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.com
Keep clicking the refresh button, you will see the limit of your browser.
2007-04-24, 4979👍, 0💬
Popular Posts:
What will be printed as the result of the operation below: main() { int x=10, y=15; x = x++; y = ++y...
What will happen in these three cases? if (a=0) { //somecode } if (a==0) { //do something } if (a===...
How do I force the Dispose method to be called automatically, as clients can forget to call Dispose ...
How To Control Table Widths? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells Usually, b...
What is COCOMO I, COCOMOII and COCOMOIII? In CD we have a complete free PDF tutorial of how to prepa...