Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Test session_set_save_handler() function : error functionality --EXTENSIONS-- ses..

Decoded Output download

--TEST--
Test session_set_save_handler() function : error functionality
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
error_reporting=0
--FILE--
<?php

ob_start();

echo "*** Testing session_set_save_handler() : error functionality ***
";

function open($save_path, $session_name) { return true; }
function close() { return true; }
function read($id) { return false; }
function write($id, $session_data) { }
function destroy($id) {  return true; }
function gc($maxlifetime) {  return true; }

session_set_save_handler("open", "close", "read", "write", "destroy", "gc");

session_start();
$_SESSION["Blah"] = "Hello World!";
$_SESSION["Foo"] = FALSE;
$_SESSION["Guff"] = 1234567890;
var_dump($_SESSION);

session_write_close();
var_dump($_SESSION);
session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
session_start();
var_dump($_SESSION);
session_destroy();

ob_end_flush();
?>
--EXPECT--
*** Testing session_set_save_handler() : error functionality ***
array(3) {
  ["Blah"]=>
  string(12) "Hello World!"
  ["Foo"]=>
  bool(false)
  ["Guff"]=>
  int(1234567890)
}
array(3) {
  ["Blah"]=>
  string(12) "Hello World!"
  ["Foo"]=>
  bool(false)
  ["Guff"]=>
  int(1234567890)
}
array(0) {
}

Did this file decode correctly?

Original Code

--TEST--
Test session_set_save_handler() function : error functionality
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
error_reporting=0
--FILE--
<?php

ob_start();

echo "*** Testing session_set_save_handler() : error functionality ***\n";

function open($save_path, $session_name) { return true; }
function close() { return true; }
function read($id) { return false; }
function write($id, $session_data) { }
function destroy($id) {  return true; }
function gc($maxlifetime) {  return true; }

session_set_save_handler("open", "close", "read", "write", "destroy", "gc");

session_start();
$_SESSION["Blah"] = "Hello World!";
$_SESSION["Foo"] = FALSE;
$_SESSION["Guff"] = 1234567890;
var_dump($_SESSION);

session_write_close();
var_dump($_SESSION);
session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
session_start();
var_dump($_SESSION);
session_destroy();

ob_end_flush();
?>
--EXPECT--
*** Testing session_set_save_handler() : error functionality ***
array(3) {
  ["Blah"]=>
  string(12) "Hello World!"
  ["Foo"]=>
  bool(false)
  ["Guff"]=>
  int(1234567890)
}
array(3) {
  ["Blah"]=>
  string(12) "Hello World!"
  ["Foo"]=>
  bool(false)
  ["Guff"]=>
  int(1234567890)
}
array(0) {
}

Function Calls

None

Variables

None

Stats

MD5 1eec99031f0e7aee605fb67aec7a99d6
Eval Count 0
Decode Time 69 ms