src/Controller/MelisAuthController.php
protected function forgetMe($username, $password)
    {
        $melisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
        $authCookieConfig = $melisCoreConfig->getItem('meliscore/datas/default/auth_cookies');
        $expire = $authCookieConfig['expire'];


        $user = new SetCookie('cookie1', $this->crypt($username), strtotime($expire, time()));
        $remember = new SetCookie('remember', 0, strtotime($expire, time()));

        $this->getResponse()->getHeaders()->addHeader($user);
        $this->getResponse()->getHeaders()->addHeader($remember);

        // add code here to remove session
        $sessionManager = new SessionManager();
        $sessionManager->forgetMe();
        Container::setDefaultManager($sessionManager);
    }
protected function forgetMe($username, $password)
    {
        $melisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
        $authCookieConfig = $melisCoreConfig->getItem('meliscore/datas/default/auth_cookies');
        $expire = $authCookieConfig['expire'];


        $user = new SetCookie('cookie1', $this->crypt($username), strtotime($expire, time()));
        $remember = new SetCookie('remember', 0, strtotime($expire, time()));

        $this->getResponse()->getHeaders()->addHeader($user);
        $this->getResponse()->getHeaders()->addHeader($remember);

        // add code here to remove session
        $sessionManager = new SessionManager();
        $sessionManager->forgetMe();
        Container::setDefaultManager($sessionManager);
    }
protected function forgetMe ( $ username , $ password ) { $ melisCoreConfig = $ this -> serviceLocator -> get ( 'MelisCoreConfig' ) ; $ authCookieConfig = $ melisCoreConfig -> getItem ( 'meliscore/datas/default/auth_cookies' ) ; $ expire = $ authCookieConfig [ 'expire' ] ; $ user = new SetCookie ( 'cookie1' , $ this -> crypt ( $ username ) , strtotime ( $ expire , time ( ) ) ) ; $ remember = new SetCookie ( 'remember' , 0 , strtotime ( $ expire , time ( ) ) ) ; $ this -> getResponse ( ) -> getHeaders ( ) -> addHeader ( $ user ) ; $ this -> getResponse ( ) -> getHeaders ( ) -> addHeader ( $ remember ) ; // add code here to remove session $ sessionManager = new SessionManager ( ) ; $ sessionManager -> forgetMe ( ) ; Container :: setDefaultManager ( $ sessionManager ) ; }
Forget me function

@param string $username
@param string $password
Forget me function