1--TEST--
2sqlite, session destroy test
3--CREDITS--
4Mats Lindh <mats at lindh.no>
5#Testfest php.no
6--INI--
7session.save_handler = sqlite
8--SKIPIF--
9if (!extension_loaded("session"))
10{
11	die("skip Session module not loaded");
12}
13if (!extension_loaded("sqlite"))
14{
15	die("skip sqlite module not loaded");
16}
17--FILE--
18<?php
19/* Description: Tests that sqlite will destroy a session when used as a session handler
20* Source code: ext/sqlite/sess_sqlite.c
21*/
22ob_start();
23session_save_path(__DIR__ . "/sessiondb.sdb");
24
25// start a session and save a value to it before commiting the session to the database
26session_start();
27$_SESSION["test"] = "foo_bar";
28session_write_close();
29
30// remove the session value
31unset($_SESSION["test"]);
32var_dump(isset($_SESSION["test"]));
33
34// start the session again and destroy it
35session_start();
36var_dump($_SESSION["test"]);
37session_destroy();
38session_write_close();
39
40unset($_SESSION["test"]);
41
42// check that the session has been destroyed
43session_start();
44var_dump(isset($_SESSION["test"]));
45ob_end_flush();
46?>
47--EXPECTF--
48bool(false)
49%unicode|string%(7) "foo_bar"
50bool(false)
51--CLEAN--
52<?php
53	unlink(__DIR__ . "/sessiondb.sdb")
54?>
55