1 |
<?php |
2 |
|
3 |
ini_set("session.use_cookies", "0"); |
4 |
|
5 |
class YakkaCookieHandler { |
6 |
var $name; |
7 |
var $ticket; |
8 |
|
9 |
function YakkaCookieHandler($name = null) { |
10 |
if (!$name) |
11 |
$this->name = "YakkaCookie"; |
12 |
else |
13 |
$this->name = $name; |
14 |
|
15 |
global $HTTP_COOKIE_VARS; |
16 |
|
17 |
if ($HTTP_COOKIE_VARS[$this->name]) |
18 |
$this->ticket = $HTTP_COOKIE_VARS[$this->name]; |
19 |
else |
20 |
$this->ticket = null; |
21 |
} |
22 |
|
23 |
function clearCookie() { |
24 |
setcookie($this->name, "", 1, "/"); |
25 |
} |
26 |
|
27 |
function &loadCookie() { |
28 |
return $this->ticket; |
29 |
} |
30 |
|
31 |
function saveCookie() { |
32 |
global $HTTP_COOKIE_VARS; |
33 |
setcookie($this->name, $this->ticket, 0, "/"); |
34 |
} |
35 |
} |
36 |
|
37 |
?> |