Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 8293db9fdd
Fetching contributors…

Cannot retrieve contributors at this time

58 lines (55 sloc) 2.194 kB
$name = 'TestCookieInfo';
$value = 'Test Cookie Value';
$expire = time() + 86400;
$path = '/';
$domain = $_SERVER['HTTP_HOST'];
$secure = true;
$httpOnly = true;
setcookie($name, $value, $expire, $path, $domain, true, true);
<!DOCTYPE html>
<title>Cookie Entry</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="../../_common/testcase.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript">
window.addEventListener("load", function() {
var expires = new Date(<?php echo $expire * 1000 ?>);
var expiresElement = document.getElementById("expires");
expiresElement.textContent = expires.toLocaleString();
}, false);
<h1>Cookie Entry</h1>
<section id="description">
<h3>Steps to reproduce</h3>
<li>Open Firebug</li>
<li>Enable and switch to the <em>Cookies</em> panel</li>
<li>Reload the page</li>
<h3>Expected result</h3>
There should be a cookie listed with the following info:<br/>
Name: <code><?php echo $name ?></code><br/>
Value: <code><?php echo $value ?></code><br/>
Domain: <code><?php echo $domain ?></code><br/>
Size: <code><?php echo (strlen($name) + strlen($value)) ?> B</code><br/>
Path: <code><?php echo $path ?></code><br/>
Expires: <code id="expires"></code><br/>
HttpOnly: <code><?php echo $httpOnly ? "HttpOnly" : "" ?></code><br/>
Secure: <code><?php echo $secure ? "Secure" : "" ?></code>
<footer>Sebastian Zartner,</footer>
Jump to Line
Something went wrong with that request. Please try again.