Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Tags:** comments, sessions
**Requires at least:** 4.7
**Tested up to:** 5.4
**Stable tag:** 1.1.0
**Stable tag:** 1.2.0
**Requires PHP:** 5.4
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -67,6 +67,9 @@ However, if you intend to scale your application, local tempfiles are a dangerou

## Changelog ##

### 1.2.0 (May 18th, 2020) ###
* Avoids using cookies for sessions when WP-CLI is executing [[#154](https://github.com/pantheon-systems/wp-native-php-sessions/pull/154)].

### 1.1.0 (April 23rd, 2020) ###
* Avoids initializing PHP sessions when doing cron [[#149](https://github.com/pantheon-systems/wp-native-php-sessions/pull/149)].

Expand Down
10 changes: 7 additions & 3 deletions pantheon-sessions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: Native PHP Sessions for WordPress
* Version: 1.1.0
* Version: 1.2.0
* Description: Offload PHP's native sessions to your database for multi-server compatibility.
* Author: Pantheon
* Author URI: https://www.pantheon.io/
Expand All @@ -14,7 +14,7 @@

use Pantheon_Sessions\Session;

define( 'PANTHEON_SESSIONS_VERSION', '1.1.0' );
define( 'PANTHEON_SESSIONS_VERSION', '1.2.0' );

/**
* Main controller class for the plugin.
Expand Down Expand Up @@ -141,7 +141,11 @@ private function set_ini_values() {

// Use session cookies, not transparent sessions that puts the session id in
// the query string.
ini_set( 'session.use_cookies', '1' );
$use_cookies = '1';
if ( defined( 'WP_CLI' ) && WP_CLI ) {
$use_cookies = '0';
}
ini_set( 'session.use_cookies', $use_cookies );
ini_set( 'session.use_only_cookies', '1' );
ini_set( 'session.use_trans_sid', '0' );
// Don't send HTTP headers using PHP's session handler.
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: getpantheon, outlandish josh, mpvanwinkle77, danielbachhuber, andr
Tags: comments, sessions
Requires at least: 4.7
Tested up to: 5.4
Stable tag: 1.1.0
Stable tag: 1.2.0
Requires PHP: 5.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -67,6 +67,9 @@ If you see an error like "Fatal error: session_start(): Failed to initialize sto

== Changelog ==

= 1.2.0 (May 18th, 2020) =
* Avoids using cookies for sessions when WP-CLI is executing [[#154](https://github.com/pantheon-systems/wp-native-php-sessions/pull/154)].

= 1.1.0 (April 23rd, 2020) =
* Avoids initializing PHP sessions when doing cron [[#149](https://github.com/pantheon-systems/wp-native-php-sessions/pull/149)].

Expand Down