XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
Session.php
Go to the documentation of this file.
1
<?php
2
/*
3
You may not change or alter any portion of this comment or credits
4
of supporting developers from this source code or any supporting source code
5
which is considered copyrighted (c) material of the original comment or credit authors.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
namespace
Xmf\Module
;
13
14
use
Xmf\Module\Helper\AbstractHelper
;
15
32
class
Session
extends
AbstractHelper
33
{
37
private
$prefix
;
38
44
public
function
init
()
45
{
46
$this->
prefix
= $this->
module
->getVar(
'dirname'
) .
'_'
;
47
}
48
56
private
function
prefix
(
$name
)
57
{
58
$prefixedName = $this->
prefix
.
$name
;
59
60
return
$prefixedName;
61
}
62
71
public
function
set
(
$name
, $value)
72
{
73
$prefixedName = $this->
prefix
(
$name
);
74
$_SESSION
[$prefixedName] = serialize($value);
75
}
76
84
public
function
get
(
$name
)
85
{
86
$prefixedName = $this->
prefix
(
$name
);
87
if
(isset(
$_SESSION
[$prefixedName])) {
88
return
unserialize(
$_SESSION
[$prefixedName]);
89
}
else
{
90
return
false
;
91
}
92
}
93
101
public
function
del
(
$name
)
102
{
103
$prefixedName = $this->
prefix
(
$name
);
104
$_SESSION
[$prefixedName] = null;
105
unset(
$_SESSION
[$prefixedName]);
106
}
107
113
public
function
destroy
()
114
{
115
foreach
(
$_SESSION
as $key => $value) {
116
if
(0 == substr_compare($key, $this->
prefix
, 0, strlen($this->
prefix
))) {
117
$_SESSION
[$key] = null;
118
unset(
$_SESSION
[$key]);
119
}
120
}
121
}
122
}
Xmf\Module\Session
Definition:
Session.php:32
$_SESSION
$_SESSION['RF']["verify"]
Definition:
dialog.php:4
Xmf\Module\Session\del
del($name)
Definition:
Session.php:101
module
Xmf\Module
Definition:
Admin.php:12
Xmf\Module\Helper\AbstractHelper
Definition:
AbstractHelper.php:31
Xmf\Module\Session\init
init()
Definition:
Session.php:44
Xmf\Module\Session\$prefix
$prefix
Definition:
Session.php:37
Xmf\Module\Session\destroy
destroy()
Definition:
Session.php:113
Xmf\Module\Session\prefix
prefix($name)
Definition:
Session.php:56
AbstractHelper
$name
$name
Definition:
force_download.php:15
Xmf\Module\Session\set
set($name, $value)
Definition:
Session.php:71
usr64
htdocs
xoops_lib
Xmf
Module
Session.php
Generated on Fri May 22 2015 03:07:05 for XOOPS by
1.8.9.1