public function storeCookie( $comment = null )
    {
        $userData = array();
        $sessionID = session_id();
        $currentUser = eZUser::currentUser();
        if( is_null( $comment ) )
        {
            if( $currentUser->isAnonymous() )
            {
                return '';
            }
            else
            {
                $userData[$sessionID] = array( 'email' => $currentUser->attribute( 'email' ),
                                               'name' => $currentUser->contentObject()->name() );
            }
        }
        else
        {
            $userData[$sessionID] = array( 'email' => $comment->attribute( 'email' ),
                                           'website' => $comment->attribute( 'url' ),
                                           'name' => $comment->attribute( 'name' ) );
            if ( !$currentUser->isAnonymous() )
            {
                $userData[$sessionID]['email'] = $currentUser->attribute( 'email' );
            }
        }
        setcookie( 'eZCommentsUserData', base64_encode( json_encode( $userData ) ), $this->expiryTime, '/' );
        return $userData;
    }
public function storeCookie( $comment = null )
    {
        $userData = array();
        $sessionID = session_id();
        $currentUser = eZUser::currentUser();
        if( is_null( $comment ) )
        {
            if( $currentUser->isAnonymous() )
            {
                return '';
            }
            else
            {
                $userData[$sessionID] = array( 'email' => $currentUser->attribute( 'email' ),
                                               'name' => $currentUser->contentObject()->name() );
            }
        }
        else
        {
            $userData[$sessionID] = array( 'email' => $comment->attribute( 'email' ),
                                           'website' => $comment->attribute( 'url' ),
                                           'name' => $comment->attribute( 'name' ) );
            if ( !$currentUser->isAnonymous() )
            {
                $userData[$sessionID]['email'] = $currentUser->attribute( 'email' );
            }
        }
        setcookie( 'eZCommentsUserData', base64_encode( json_encode( $userData ) ), $this->expiryTime, '/' );
        return $userData;
    }
public function storeCookie ( $ comment = null ) { $ userData = array ( ) ; $ sessionID = session_id ( ) ; $ currentUser = eZUser :: currentUser ( ) ; if ( is_null ( $ comment ) ) { if ( $ currentUser -> isAnonymous ( ) ) { return '' ; } else { $ userData [ $ sessionID ] = array ( 'email' => $ currentUser -> attribute ( 'email' ) , 'name' => $ currentUser -> contentObject ( ) -> name ( ) ) ; } } else { $ userData [ $ sessionID ] = array ( 'email' => $ comment -> attribute ( 'email' ) , 'website' => $ comment -> attribute ( 'url' ) , 'name' => $ comment -> attribute ( 'name' ) ) ; if ( ! $ currentUser -> isAnonymous ( ) ) { $ userData [ $ sessionID ] [ 'email' ] = $ currentUser -> attribute ( 'email' ) ; } } setcookie ( 'eZCommentsUserData' , base64_encode ( json_encode ( $ userData ) ) , $ this -> expiryTime , '/' ) ; return $ userData ; }
store data into cookie
if field is null, set cookie based on user data, other wise set cookie based on fields
@param $comment comment object
@return arrary stored data
store data into cookie if field is null set cookie based on user data other wise set cookie based on fields