CakePHP – Sessions


print_r($this -> Session -> read());

$this -> Session -> write("variable", "value");
$this -> Session -> read("variable");

$user_email = $this -> data['User']['email'];
$user       = $this -> User -> find("email = '$user_email'");
$this -> Session -> write('User', $user['User']);

$this -> Session -> read("User.email");

if ($this -> Session -> valid()){
	$this -> Session -> destroy();
	$this -> redirect('/');
}
Source:
http://justkez.com/understanding-cakephp-sessions/

One thought on “CakePHP – Sessions

  1. Pingback: ezineaerticles » Blog Archive » CakePHP - Sessions

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s