---
title: "Setcookie"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/16547-setcookie"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "Niklasson"
published: "2002-01-07T21:29:00.000Z"
updated: "2002-01-07T21:29:00.000Z"
replies: 0
views: 153
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/php/16547-setcookie"
---

# Setcookie

## #1 — Niklasson, 2002-01-07T21:29Z

Jag har ett skumt fel. Kolla <http://www.niklasson.net/test.php> 

```
<?
if ($kaknamn == 1)
{
echo "Kakan fanns redan...";
}
else
{
Setcookie("kaknamn", "1", time()+15);
echo "Kakan sattes i 15 sekunder...";
}

$tid = time();
$datum = date("Y-m-d H:i:s", $tid);
echo "<p>$datum ($tid)";
?>
```

Snälla, har jag gjort nåt fel eller??

Permalänk: https://www.webforum.nu/p/16547

---

Tråden på webben: https://www.webforum.nu/amne/php/16547-setcookie
