Jump to content

phpBB Login integration not keeping staying logged in


Dyno

Recommended Posts

Ok so i downloaded some good code to help my website integrate with phpBB the code i'm using is

 

<?



class PHPBB_Login {



    function PHPBB_Login() {

    }



    function login( $phpbb_user_id ) {

        global $db, $board_config;

        global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;



        // Setup the phpbb environment and then

        // run through the phpbb login process



        // You may need to change the following line to reflect

        // your phpBB installation.

        require_once( './forums/config.php' );



        define('IN_PHPBB',true);



        // You may need to change the following line to reflect

        // your phpBB installation.

        $phpbb_root_path = "./forums/";



        require_once( $phpbb_root_path . "extension.inc" );

        require_once( $phpbb_root_path . "common.php" );



        return session_begin( $phpbb_user_id, $user_ip, PAGE_INDEX, FALSE, TRUE );



    }



    function logout( $session_id, $phpbb_user_id ) {

        global $db, $lang, $board_config;

        global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;



        // Setup the phpbb environment and then

        // run through the phpbb login process



        // You may need to change the following line to reflect

        // your phpBB installation.

        require_once( './forums/config.php' );



        define('IN_PHPBB',true);



        // You may need to change the following line to reflect

        // your phpBB installation.

        $phpbb_root_path = "./forums/";



        require_once( $phpbb_root_path . "extension.inc" );

        require_once( $phpbb_root_path . "common.php" );



        session_end( $session_id, $phpbb_user_id );



        // session_end doesn't seem to get rid of these cookies,

        // so we'll do it here just in to make certain.

        setcookie( $board_config[ "phpbb2mysql" ] . "_sid", "", time() - 3600, " " );

        setcookie( $board_config[ "phpbb2mysql" ] . "_mysql", "", time() - 3600, " " );



    }



}



?>

 

once i click the remember me box and go back to the index it asks me to login again but i want it to hold the login.

 

Any help would be nice thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.