2 comments

  1. If you will work with sessions, then init this at first in your plugin, theme.

    add_action( 'init', 'my_start_session' );
    
    function my_start_session() {
    
        if ( session_id() )
            return;
    
        @session_cache_limiter('private, must-revalidate'); //private_no_expire
        @session_cache_expire(0);
        @session_start();
    }
    

    Alternative use the library from Eric Mann: WP Session Manager, also his tutorial.

  2. I have a really simple script that is linked https://wordpress.stackexchange.com/questions/154802/what-do-i-need-to-do-to-fully-integrate-a-custom-session-login-into-wp.

    Basically I am assuming that your SSO is secure, that you have the users in your database, and that you don’t need to keep the session alive except for authentication. From my standpoint I just want to pass the user onto WP and let the WP user system do the rest. Hope this helps others doing session logins.

Comments are closed.