Skip to content

Instantly share code, notes, and snippets.

@yohgaki
Last active January 28, 2016 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yohgaki/2a19756978837e4dd07c to your computer and use it in GitHub Desktop.
Save yohgaki/2a19756978837e4dd07c to your computer and use it in GitHub Desktop.
Work around for PHP7
diff --git a/ext/session/session.c b/ext/session/session.c
index fc91eda..3dec117 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2089,7 +2089,7 @@ static PHP_FUNCTION(session_regenerate_id)
RETURN_FALSE;
}
}
- PS(mod)->s_close(&PS(mod_data));
+ /* PS(mod)->s_close(&PS(mod_data)); */
/* New session data */
if (PS(session_vars)) {
@@ -2103,6 +2103,7 @@ static PHP_FUNCTION(session_regenerate_id)
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create new session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
RETURN_FALSE;
}
+ PS(mod)->s_close(&PS(mod_data));
if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name)) == FAILURE) {
PS(session_status) = php_session_none;
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failed to create(open) session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment