Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (58 sloc) 1.92 KB
setcookie("TestCookie50", "CookieValue50", time() + 86400, "/", "", false, false);
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title>Break On Next</title>
<link rel="stylesheet" href="../tests.css" type="text/css"/>
<script type="text/javascript" src="javascript_cookies.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<h1>Break on cookie change</h1>
<i>Jan Odvarko,</i>
<li>Open Firebug and enable the <b>Cookies</b> panel.</li>
<li>Click on <code>Break on Cookie</code> button
(<img src="chrome://firebug/skin/breakNextActive.png" style="vertical-align: bottom;"/>).</li>
<li>Click on one of the buttons bellow.</li>
<li>The script execution must be stopped by Firebug debugger and
the propert source code line must be displayed.</li>
<button id="addCookie" onclick="onAddCookie()">Add Cookie</button>
<button id="removeCookie" onclick="onRemoveCookie()">Remove Cookie</button>
<button id="changeCookie" onclick="onChangeCookie()">Change Cookie</button>
<script type="text/javascript">
var domain = "";
function onAddCookie()
var time = (new Date()).getTime();
Set_Cookie("TestCookie50" + time, "Some Value", time + 3600 * 1000,
"/", domain, false);
function onRemoveCookie()
if (!Get_Cookie("TestCookie50"))
alert("The cookie has been deleted.\nRefresh the page to " +
"get it from the server again.");
Delete_Cookie("TestCookie50", "/", domain);
function onChangeCookie()
var time = (new Date()).getTime();
if (!Get_Cookie("TestCookie50"))
Set_Cookie("TestCookie50", "Some Value", time + 3600 * 1000,
"/", domain, false);
Set_Cookie("TestCookie50", "New Value: " + time, time + 3600 * 1000,
"/", domain, false);
Jump to Line
Something went wrong with that request. Please try again.