Open Sencillo
2015.107
Long live the simplicity of PHP
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
All
Data Structures
Namespaces
Functions
Pages
cookies.php
1
<?php
2
/*~ cookies.php
3
.---------------------------------------------------------------------------.
4
| Software: Sencillo Cookies |
5
| Version: 2015.003 |
6
| Contact:
[email protected]
|
7
| ------------------------------------------------------------------------- |
8
| Author: Bc. Peter Horváth (original founder) |
9
| Copyright (c) 2015, Bc. Peter Horváth. All Rights Reserved. |
10
| ------------------------------------------------------------------------- |
11
| License: Distributed under the General Public License (GPL) |
12
| http://www.gnu.org/licenses/gpl-3.0.html |
13
| This program is distributed in the hope that it will be useful - WITHOUT |
14
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
15
| FITNESS FOR A PARTICULAR PURPOSE. |
16
'---------------------------------------------------------------------------'
17
~*/
27
class
getCookies
28
{
29
private
$name;
30
private
$expiration;
31
private
$data;
32
36
public
function
__construct
()
37
{
38
$this->expiration = time()+3600;
39
}
40
45
public
function
setExpiration
($time)
46
{
47
$this->expiration = time()+($time*60);
48
}
49
55
public
function
addCookie
($name,$data)
56
{
57
$this->name = $name;
58
59
$this->data = $data;
60
setcookie($this->name,$this->data,$this->expiration);
61
}
62
67
public
function
removeCookie
($name)
68
{
69
$this->name = $name;
70
71
setcookie($this->name,
""
,time()-3600);
72
}
73
79
public
function
getCookie($name)
80
{
81
$this->name = $name;
82
83
return
$_COOKIE[$this->name];
84
}
85
}
86
?>
getCookies\addCookie
addCookie($name, $data)
Definition:
cookies.php:55
getCookies\setExpiration
setExpiration($time)
Definition:
cookies.php:45
getCookies\removeCookie
removeCookie($name)
Definition:
cookies.php:67
getCookies
Definition:
cookies.php:27
getCookies\__construct
__construct()
Definition:
cookies.php:36
fw_headers
cookies.php
Generated on Thu Jul 2 2015 04:02:29 for Open Sencillo by
1.8.6