protected function generateRememberMeCookie($username)
    {
        $key = 'ThisTokenIsNotSoSecretChangeIt';
        $class = 'WobbleCode\UserBundle\Document\User';
        $password = 'none';
        $expires = time()+2592000;

        $hash = hash('sha256', $class.$username.$expires.$password.$key);

        return $this->encodeCookie([$class, base64_encode($username), $expires, $hash]);
    }
protected function generateRememberMeCookie($username)
    {
        $key = 'ThisTokenIsNotSoSecretChangeIt';
        $class = 'WobbleCode\UserBundle\Document\User';
        $password = 'none';
        $expires = time()+2592000;

        $hash = hash('sha256', $class.$username.$expires.$password.$key);

        return $this->encodeCookie([$class, base64_encode($username), $expires, $hash]);
    }
protected function generateRememberMeCookie ( $ username ) { $ key = 'ThisTokenIsNotSoSecretChangeIt' ; $ class = 'WobbleCode\UserBundle\Document\User' ; $ password = 'none' ; $ expires = time ( ) + 2592000 ; $ hash = hash ( 'sha256' , $ class . $ username . $ expires . $ password . $ key ) ; return $ this -> encodeCookie ( [ $ class , base64_encode ( $ username ) , $ expires , $ hash ] ) ; }
Generate remember me cookie final value

@todo Add bundle option to define the class name
@todo Add bundle option to get the expire time
@todo Add functionality to get the secret key from service

@param string $username Username to remember

@return string Cookie final value
Generate remember me cookie final value