Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • sessions in cakephp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 62
    Comment on it

    Session component provides a way to persist the data between HTTP requests. We can put any value to name and by this way we can write the session.

    SessionComponent::write($name, $value)
    
    $this->Session->write('User.fruit, 'apple');
    

    Which writes the value apple to the name fruit under user.Means User=>fruit

        SessionComponent::read($name)
    
    $var = $this->Session->read('User.fruit');
    

    We can read the session with the help of session component read function which has one parameter. it returns the value $name in the session.

        SessionComponent::delete($name)
    
    $this->Session->delete('User.fruit');
    

    It clear the session data

      SessionComponent::destroy()
    
       $this->Session->destroy();
    

    It will delete the all session data.we can destroy the php session and create a fresh session.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: