Zend_Session_Validator Problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Zend_Session_Validator Problem

D h @ v @ l
Hi all,

    I want to authenticate session, I found new vaildator in 1.8 . I tried to implement that so I have added code below to my bootstrap.php file.

protected function _initSessionCheck()
    {
        /** Register Session Validator for Validation purpose */
        Zend_Session::registerValidator(new My_Session_Validate());
    }

Now My_Session_Validate class is in file library/My/Session/Validate.php
<?php

class My_Session_Validate implements Zend_Session_Validator_Interface
{
    /**
     * Setup() - this method will store the environment variables
     * necessary to be able to validate against in future requests.
     *
     * @return void
     */
    public function setup()
    {
        //Zend_Debug::dump($_SERVER);
    }

    /**
     * Validate() - this method will be called at the beginning of
     * every session to determine if the current environment matches
     * that which was store in the setup() procedure.
     *
     * @return boolean
     */
    public function validate()
    {
        Zend_Debug::dump($_SERVER);
    }
}
?>

Here setup method has been called every time when request go to server, but validate method doesnt called any single time.
I havent put my validation code here, I want to check that does validate method is called or not?

Waiting for Quick Replay,

Thanks,
Dhaval