FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phpredis/tests/getSessionData.php at develop · phpredis/phpredis · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
phpredis
/
phpredis
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
10.2k
Code
Issues
100
Pull requests
34
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
phpredis
/
tests
/
getSessionData.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (26 loc) · 843 Bytes
Breadcrumbs
phpredis
/
tests
/
getSessionData.php
Copy path
File metadata and controls
33 lines (26 loc) · 843 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
require_once
__DIR__
.
'
/SessionHelpers.php
'
;
error_reporting
(
E_ERROR
|
E_WARNING
);
$
opt
=
getopt
(
''
, [
'
handler:
'
,
'
save-path:
'
,
'
id:
'
,
'
lifetime:
'
]);
$
handler
=
$
opt
[
'
handler
'
] ??
NULL
;
$
save_path
=
$
opt
[
'
save-path
'
] ??
NULL
;
$
id
=
$
opt
[
'
id
'
] ??
NULL
;
$
lifetime
=
$
opt
[
'
lifetime
'
] ??
NULL
;
if
( !
$
handler
) {
fprintf
(
STDERR
,
"
--handler is required
\n"
);
exit
(
1
);
}
else
if
( !
$
save_path
) {
fprintf
(
STDERR
,
"
--save-path is required
\n"
);
exit
(
1
);
}
ini_set
(
'
session.save_handler
'
,
$
handler
);
ini_set
(
'
session.save_path
'
,
$
save_path
);
ini_set
(
'
session.gc_maxlifetime
'
,
$
lifetime
);
session_id
(
$
id
);
if
( !
session_start
()) {
fprintf
(
STDERR
,
"
session_start() was nut successful
"
);
exit
(
1
);
}
else
{
echo
isset
(
$
_SESSION
[
'
redis_test
'
]) ?
$
_SESSION
[
'
redis_test
'
] :
'
Key redis_test not found
'
;
exit
(
0
);
}
Back
|
FazBrowse Home
|
New Git URL