session.php File Reference

Go to the source code of this file.

Namespaces

namespace  cake

Functions

 __close ()
 __construct ($base=null, $start=true)
 __destroy ($key)
 __error ($errorNumber)
 __gc ($expires=null)
 __initSession ()
 __open ()
 __overwrite (&$old, $new)
 __read ($key)
 __regenerateId ()
 __returnSessionVars ()
 __setError ($errorNumber, $errorMessage)
 __startSession ()
 __validateKeys ($name)
 __write ($key, $value)
 _checkValid ()
 check ($name)
 del ($name)
 destroy ()
 error ()
 id ($id=null)
 ignore ($var)
 read ($name=null)
 renew ()
 start ()
 started ()
 valid ()
 watch ($var)
 write ($name, $value)

Variables

 $id = null


Function Documentation

__close (  ) 

Method called on close of a database session.

Returns:
boolean Success private

Definition at line 672 of file session.php.

References __gc(), cache(), Cache::gc(), and Configure::read().

Referenced by __initSession().

__construct ( base = null,
start = true 
)

Constructor.

Parameters:
string $base The base path for the Session
boolean $start Should session be started right now public

Definition at line 127 of file session.php.

References __construct(), env(), App::import(), Security::inactiveMins(), md5(), and Configure::read().

__destroy ( key  ) 

Method called on the destruction of a database session.

Parameters:
integer $key Key that uniquely identifies session in database
Returns:
boolean Success private

Definition at line 759 of file session.php.

References ConnectionManager::getDataSource(), name(), and Configure::read().

Referenced by __initSession().

__error ( errorNumber  ) 

Return error description for given error number.

Parameters:
integer $errorNumber Error to set
Returns:
string Error as string private

Definition at line 267 of file session.php.

References error().

Referenced by error().

__gc ( expires = null  ) 

Helper function called on gc for database sessions.

Parameters:
integer $expires Timestamp (defaults to current time)
Returns:
boolean Success private

Definition at line 772 of file session.php.

References ConnectionManager::getDataSource(), name(), and Configure::read().

Referenced by __close(), and __initSession().

__initSession (  ) 

Helper method to initialize a session, based on Cake core settings.

private

Definition at line 415 of file session.php.

References $config, __(), __close(), __destroy(), __gc(), __open(), __read(), __write(), cache(), env(), low(), read(), Configure::read(), uses(), write(), and Configure::write().

Referenced by __regenerateId(), and start().

__open (  ) 

Method called on open of a database session.

Returns:
boolean Success private

Definition at line 663 of file session.php.

Referenced by __initSession().

__overwrite ( &$  old,
new 
)

Used to write new data to _SESSION, since PHP doesn't like us setting the _SESSION var itself

Parameters:
array $old Set of old variables => values
array $new New set of variable => value private

Definition at line 248 of file session.php.

Referenced by del(), and write().

__read ( key  ) 

Method used to read from a database session.

Parameters:
mixed $key The key of the value to read
Returns:
mixed The value of the key or false if it does not exist private

Definition at line 693 of file session.php.

References ConnectionManager::getDataSource(), name(), and Configure::read().

Referenced by __initSession().

__regenerateId (  ) 

Helper method to restart a session.

Returns:
void private

Definition at line 590 of file session.php.

References __initSession(), and Configure::read().

Referenced by renew().

__returnSessionVars (  ) 

Returns all session variables.

Returns:
mixed Full $_SESSION array, or false on error. private

Definition at line 334 of file session.php.

References __setError().

Referenced by read().

__setError ( errorNumber,
errorMessage 
)

Helper method to set an internal error message.

Parameters:
integer $errorNumber Number of the error
string $errorMessage Description of the error
Returns:
void private

Definition at line 650 of file session.php.

References error().

Referenced by __returnSessionVars(), __validateKeys(), _checkValid(), del(), read(), and valid().

__startSession (  ) 

Helper method to start a session

private

Definition at line 532 of file session.php.

Referenced by start().

__validateKeys ( name  ) 

Validate that the $name is in correct dot notation example: $name = 'ControllerName.key';

Parameters:
string $name Session key names as string.
Returns:
mixed false is $name is not correct format, or $name if it is correct private

Definition at line 635 of file session.php.

References __setError().

Referenced by check(), del(), ignore(), watch(), and write().

__write ( key,
value 
)

Helper function called on write for database sessions.

Parameters:
mixed $key The name of the var
mixed $value The value of the var
Returns:
boolean Success private

Definition at line 716 of file session.php.

References ConnectionManager::getDataSource(), low(), name(), and Configure::read().

Referenced by __initSession().

_checkValid (  ) 

Helper method to create a new session.

Returns:
void protected

Definition at line 554 of file session.php.

References __setError(), destroy(), Security::inactiveMins(), Configure::read(), read(), renew(), valid(), and write().

Referenced by destroy().

check ( name  ) 

Returns true if given variable is set in session.

Parameters:
string $name Variable name to check for
Returns:
boolean True if variable is there public

Definition at line 195 of file session.php.

References __validateKeys(), and Set::extract().

Referenced by Configure::__loadBootstrap(), ShellDispatcher::_initEnvironment(), Validation::alphaNumeric(), Validation::cc(), SessionHelper::check(), AclShell::check(), del(), Validation::email(), ProjectTask::execute(), SessionHelper::flash(), AclShell::help(), Validation::notEmpty(), and MediaView::render().

del ( name  ) 

Removes a variable from session.

Parameters:
string $name Session variable to remove
Returns:
boolean Success public

Definition at line 228 of file session.php.

References __overwrite(), __setError(), __validateKeys(), check(), and Set::remove().

Referenced by SessionHelper::flash().

destroy (  ) 

Helper method to destroy invalid sessions.

Returns:
void public

Definition at line 403 of file session.php.

References Object::__construct(), _checkValid(), renew(), and start().

Referenced by _checkValid().

error (  ) 

Returns last occurred error as a string, if any.

Returns:
mixed Error description as a string, or false. public

Definition at line 280 of file session.php.

References __error().

Referenced by ShellDispatcher::__bootstrap(), CakeSchema::__columns(), __error(), Scaffold::__scaffoldDelete(), Scaffold::__scaffoldError(), __setError(), Shell::_checkArgs(), Helper::_initInputField(), Debugger::_output(), Object::cakeError(), AclShell::checkNodeType(), HttpSocket::decodeBody(), SessionHelper::error(), View::error(), DboSource::execute(), DboSource::logQuery(), DboSource::queryAssociation(), DboOracle::queryAssociation(), DboSource::rawQuery(), DboSource::showQuery(), valid(), and CakeLog::write().

id ( id = null  ) 

Returns the Session id

Parameters:
id $name string
Returns:
string Session id public

Definition at line 210 of file session.php.

References $id.

Referenced by Model::_findNeighbors(), Model::del(), Model::deleteAll(), Model::getID(), SessionHelper::id(), Model::isUnique(), Model::read(), Model::saveAll(), and Model::saveField().

ignore ( var  ) 

Tells Session to stop watching a given key path

Parameters:
mixed $var The variable path to watch
Returns:
void public

Definition at line 364 of file session.php.

References __validateKeys().

read ( name = null  ) 

Returns given session variable, or all of them, if no parameters given.

Parameters:
mixed $name The name of the session variable (or a path as sent to Set.extract)
Returns:
mixed The value of the session variable public

Definition at line 313 of file session.php.

References __returnSessionVars(), __setError(), and Set::extract().

renew (  ) 

Restarts this session.

public

Definition at line 624 of file session.php.

References __regenerateId().

Referenced by _checkValid(), and destroy().

start (  ) 

Starts the Session.

Parameters:
string $name Variable name to check for
Returns:
boolean True if variable is there public

Definition at line 169 of file session.php.

References __initSession(), and __startSession().

Referenced by DbConfigTask::__interactive(), TestSuiteShell::__run(), SessionHelper::__start(), Debugger::_output(), PaginatorHelper::counter(), destroy(), Debugger::log(), and Debugger::trace().

started (  ) 

Determine if Session has been started.

public

Returns:
boolean True if session has been started.

Definition at line 182 of file session.php.

Referenced by SessionHelper::__start().

valid (  ) 

Returns true if session is valid.

Returns:
boolean Success public

Definition at line 293 of file session.php.

References __setError(), error(), Configure::read(), and read().

Referenced by _checkValid(), BakeShell::all(), AuthComponent::isAuthorized(), and SessionHelper::valid().

watch ( var  ) 

Tells Session to write a notification when a certain session path or subpath is written to

Parameters:
mixed $var The variable path to watch
Returns:
void public

Definition at line 348 of file session.php.

References __validateKeys().

write ( name,
value 
)

Writes value to given session variable name.

Parameters:
mixed $name Name of variable
string $value Value to write
Returns:
boolean True if the write was successful, false if the write failed public

Definition at line 385 of file session.php.

References __overwrite(), __validateKeys(), Debugger::exportVar(), Set::extract(), and Set::insert().


Variable Documentation

$id = null

Definition at line 119 of file session.php.

Referenced by Set::__flatten(), Scaffold::__scaffoldDelete(), ExtractTask::__searchDirectory(), XmlNode::child(), TreeBehavior::childcount(), TreeBehavior::children(), Controller::constructClasses(), FormHelper::create(), DboSource::create(), DataSource::delete(), AjaxHelper::div(), AjaxHelper::divEnd(), Helper::domId(), TreeBehavior::getparentnode(), TreeBehavior::getpath(), AclShell::getPath(), DboSource::hasAny(), id(), ClassRegistry::init(), DataSource::insertQueryData(), DboMysqli::lastInsertId(), DboMysql::lastInsertId(), DboMssql::lastInsertId(), Controller::loadModel(), Router::mapResources(), TreeBehavior::movedown(), TreeBehavior::moveup(), TreeBehavior::recover(), TreeBehavior::removefromtree(), MediaView::render(), TreeBehavior::reorder(), AjaxHelper::slider(), and String::uuid().


Generated on Sun Nov 22 00:30:54 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7