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 View the Content of a Cookie File
How View the Content of a Cookie File? - PHP Script Tips - Understanding and Managing Cookies
✍: FYIcenter.com
Cookie files are normal text files. You can view them with any text editor. Follow the steps below to see what is in a cookie file created by your own PHP script.
Copy the following sample script, setting_persistent_cookies.php, to your Web server:
<?php setcookie("LoginName","FYICenter"); setcookie("PreferredColor","Blue"); setcookie("CouponNumber","07470433",time()+60*60*24*7); setcookie("CouponValue","100.00",time()+60*60*24*7); print("<pre>\n"); print("2 temporary cookies were delivered.\n"); print("2 consistent cookies were delivered.\n"); if (isset($_COOKIE["LoginName"])) { $loginName = $_COOKIE["LoginName"]; print("Received a cookie named as LoginName: ".$loginName."\n"); } else { print("Did not received any cookie named as LoginName.\n"); } $count = count($_COOKIE); print("$count cookies received.\n"); foreach ($_COOKIE as $name => $value) { print " $name = $value\n"; } print("</pre>\n"); ?>
Open your IE browser to visit this page: http://localhost/setting_persistent_cookies.php. You will see:
2 temporary cookies were delivered. 2 consistent cookies were delivered. Did not received any cookie named as LoginName. 0 cookies received.
Now go to \Documents and Settings\$user\Cookies directory and open the cookie file, $user@localhost.txt. You will see:
CouponNumber 07470433 localhost/ 1024 3084847744 29787636 2404950512 29786228 * CouponValue 100.00 localhost/ 1024 3084847744 29787636 2405150512 29786228 *
2007-04-24, 4870👍, 0💬
Popular Posts:
What is XSLT? XSLT is a rule based language used to transform XML documents in to other file formats...
How To Use "IF" Statements on Multiple Conditions? - Oracle DBA FAQ - Understanding PL/SQL Language ...
What are the different accessibility levels defined in .NET ? Following are the five levels of acces...
How To Create an Add-to-My-Yahoo Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS News ...
What is the main difference between a Vector and an ArrayList? Java Vector class is internally synch...