summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/cookies/script-tests/simple-cookies-expired.js
blob: 61b70fb701f0de5b61709ced437f2070626ad8f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
description(
"This test checks that cookies are correctly set using Expires."
);

clearAllCookies();

debug("Check that setting a simple cookie works.");
var date = new Date();
date.setTime(date.getTime() + 60 * 1000);
cookiesShouldBe("test=foobar; Expires=" + date.toGMTString(), "test=foobar");
clearCookies();

debug("Check setting a cookie that timed out.");
date.setTime(date.getTime() - 2 * 60 * 1000);
cookiesShouldBe("test2=foobar; Expires=" + date.toGMTString(), "");
clearCookies();

successfullyParsed = true;