View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}



1.0 - 13 November 2007: Initial release

Zend_Session_ValidatorRemoteAddr is almost a copy of Zend_Session_ValidatorHttpUserAgent with an exception, that it validates IP address of session starter

* [Component Page on|]

Nothing special requried to use this component

* This component *will not* save any data using Zend_Cache or the filesystem. All transient data *will be* saved using Zend_Session.

* Zend_Session

The component is instantized by executing Zend_Sesion::registerValidator(new Zend_Session_Validator_RemoteAddr());

The component is so simple, that it does not require any milestones

* Zend_Session_ValidatorRemoteAddr

||UC-01||You want to bind session to client IP address to improve security

try {
Zend_Session::start(); //Starting session
} catch (Zend_Session_Exception $e) {
//Unable to create session. Possibly, session validation failed
//(For example, UserAgent or IP address is changed on client. We can get reason from $e->getMessage())

//Doing something and finding out that there is a need to remember this session data
if($needToKeepThisSession) {
Zend_Sesion::registerValidator(new Zend_Session_Validator_HttpUserAgent()); //Registering first validator
Zend_Sesion::registerValidator(new Zend_Session_Validator_RemoteAddr()); //Registering second validator