Skip to content

Commit 61bf1f4

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Fix #63379 - Don't reset mod_user_is_open in destroy
2 parents 2098cc7 + 6566ea6 commit 61bf1f4

File tree

3 files changed

+114
-1
lines changed

3 files changed

+114
-1
lines changed

ext/session/mod_user_class.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ PHP_METHOD(SessionHandler, destroy)
121121
return;
122122
}
123123

124-
PS(mod_user_is_open) = 0;
125124
RETVAL_BOOL(SUCCESS == PS(default_mod)->s_destroy(&PS(mod_data), key TSRMLS_CC));
126125
}
127126
/* }}} */

ext/session/tests/bug63379.phpt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
--TEST--
2+
Bug #63379: Warning when using session_regenerate_id(TRUE) with a SessionHandler
3+
--INI--
4+
session.save_handler=files
5+
session.name=PHPSESSID
6+
--SKIPIF--
7+
<?php include('skipif.inc'); ?>
8+
--FILE--
9+
<?php
10+
11+
ob_start();
12+
13+
$handler = new SessionHandler;
14+
session_set_save_handler($handler);
15+
16+
session_start();
17+
18+
$_SESSION['foo'] = 'hello';
19+
var_dump($_SESSION);
20+
21+
session_regenerate_id(true);
22+
23+
echo "*** Regenerated ***\n";
24+
var_dump($_SESSION);
25+
26+
$_SESSION['bar'] = 'world';
27+
28+
var_dump($_SESSION);
29+
30+
session_write_close();
31+
session_unset();
32+
33+
session_start();
34+
var_dump($_SESSION);
35+
36+
--EXPECTF--
37+
array(1) {
38+
["foo"]=>
39+
string(5) "hello"
40+
}
41+
*** Regenerated ***
42+
array(1) {
43+
["foo"]=>
44+
string(5) "hello"
45+
}
46+
array(2) {
47+
["foo"]=>
48+
string(5) "hello"
49+
["bar"]=>
50+
string(5) "world"
51+
}
52+
array(2) {
53+
["foo"]=>
54+
string(5) "hello"
55+
["bar"]=>
56+
string(5) "world"
57+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
--TEST--
2+
Bug #63379: Warning when using session_regenerate_id(TRUE) with a SessionHandler
3+
--INI--
4+
session.save_handler=files
5+
session.name=PHPSESSID
6+
--SKIPIF--
7+
<?php include('skipif.inc'); ?>
8+
--FILE--
9+
<?php
10+
11+
ob_start();
12+
13+
$handler = new SessionHandler;
14+
session_set_save_handler($handler);
15+
16+
session_start();
17+
18+
$_SESSION['foo'] = 'hello';
19+
var_dump($_SESSION);
20+
21+
session_regenerate_id(false);
22+
23+
echo "*** Regenerated ***\n";
24+
var_dump($_SESSION);
25+
26+
$_SESSION['bar'] = 'world';
27+
28+
var_dump($_SESSION);
29+
30+
session_write_close();
31+
session_unset();
32+
33+
session_start();
34+
var_dump($_SESSION);
35+
36+
--EXPECTF--
37+
array(1) {
38+
["foo"]=>
39+
string(5) "hello"
40+
}
41+
*** Regenerated ***
42+
array(1) {
43+
["foo"]=>
44+
string(5) "hello"
45+
}
46+
array(2) {
47+
["foo"]=>
48+
string(5) "hello"
49+
["bar"]=>
50+
string(5) "world"
51+
}
52+
array(2) {
53+
["foo"]=>
54+
string(5) "hello"
55+
["bar"]=>
56+
string(5) "world"
57+
}

0 commit comments

Comments
 (0)