Home » , , , , , , » Get session information in cakephp

Get session information in cakephp

Written By Unknown on Kamis, 12 September 2013 | 23.30

How to get session information in cakephp 

In the controller you can use

$this->Session->read();

to get all details of session variable . And you can use

$this->set('session',$this->Session->read());


to use these values in corresponding view page.

-----------------------------------------------------------------------------------------------------------------------

If you wish to use session variable in each page then use set method in appcontroller to set its value

public function beforefilter(){
$this->set('session',$this->Session->read());
}

Now this session variable is accessible in every page of view.

Note: this should be placed in Appcontroller...

Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger