diff --git a/WP_Auth0.php b/WP_Auth0.php index ec87c846b..8ceb1cc2c 100644 --- a/WP_Auth0.php +++ b/WP_Auth0.php @@ -2,7 +2,7 @@ /** * Plugin Name: Wordpress Auth0 Integration * Description: Implements the Auth0 Single Sign On solution into Wordpress - * Version: 1.1.7 + * Version: 1.1.8 * Author: Auth0 * Author URI: https://auth0.com */ @@ -494,6 +494,7 @@ private static function login_user( $userinfo, $data ){ if (!is_null($user)) { // User exists! Log in self::updateAuth0Object($userinfo); + wp_set_auth_cookie( $user->ID ); return true; } else { @@ -573,13 +574,15 @@ public static function wp_init(){ //WP_Auth0_Options::set( 'version', 1 ); } - // Initialize session - if(!session_id()) { - session_start(); - } + // Initialize session. Disabled + //if(!session_id()) { + //session_start(); + //} } public static function end_session() { - session_destroy (); + if(session_id()) { + session_destroy (); + } } private static function setup_rewrites(){ @@ -644,7 +647,8 @@ private static function install_db(){ } public static function check_update() { - if ( get_site_option( 'auth0_db_version' ) !== AUTH0_DB_VERSION) { + + if ( get_option( 'auth0_db_version' ) != AUTH0_DB_VERSION) { self::install_db(); } }