Skip to content

Commit

Permalink
Fix session cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed May 27, 2021
1 parent 9bba9f6 commit b165197
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ext/session/tests/session_set_save_handler_closures.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ var_dump(session_module_name(FALSE));
var_dump(session_module_name("blah"));
var_dump(session_module_name("foo"));

$path = __DIR__;
$path = __DIR__ . '/session_set_save_handler_closures';
@mkdir($path);
session_save_path($path);
session_set_save_handler($open_closure, $close_closure, $read_closure, $write_closure, $destroy_closure, $gc_closure);

Expand All @@ -41,7 +42,12 @@ $_SESSION['Bar'] = 'Foo';
var_dump($_SESSION);
session_write_close();

echo "Cleanup\n";
session_start();
session_destroy();

ob_end_flush();
@rmdir($path);
?>
--EXPECTF--
*** Testing session_set_save_handler() : using closures as callbacks ***
Expand Down Expand Up @@ -90,3 +96,8 @@ array(4) {
}
Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;Bar|s:3:"Foo";]
Close [%s,PHPSESSID]
Cleanup
Open [%s,PHPSESSID]
Read [%s,%s]
Destroy [%s,%s]
Close [%s,PHPSESSID]

0 comments on commit b165197

Please sign in to comment.