1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>création de cookies</title>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<style type="text/css">
/* code css */
</style>
</head>
<body>
<!-- code xhtml -->
<script type="text/javascript">
var d = new Date();
d.setMinutes(d.getMinutes() + 2);
document.cookie = "p1=blah; expires="+ d.toUTCString(); +"; path=/;"
d.setMinutes(d.getMinutes() + 2);
document.cookie = "p2=blah; p3=blih; expires="+ d.toUTCString(); +"; path=/;"
alert(document.cookie);
</script>
</body>
</html> |