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 | |
| __close | ( | ) |
Method called on close of a database session.
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.
| 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.
| integer | $key Key that uniquely identifies session in database |
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.
| integer | $errorNumber Error to set |
Definition at line 267 of file session.php.
References error().
Referenced by error().
| __gc | ( | $ | expires = null |
) |
Helper function called on gc for database sessions.
| integer | $expires Timestamp (defaults to current time) |
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.
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
| array | $old Set of old variables => values | |
| array | $new New set of variable => value private |
Definition at line 248 of file session.php.
| __read | ( | $ | key | ) |
Method used to read from a database session.
| mixed | $key The key of the value to read |
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.
Definition at line 590 of file session.php.
References __initSession(), and Configure::read().
Referenced by renew().
| __returnSessionVars | ( | ) |
Returns all session variables.
Definition at line 334 of file session.php.
References __setError().
Referenced by read().
| __setError | ( | $ | errorNumber, | |
| $ | errorMessage | |||
| ) |
Helper method to set an internal error message.
| integer | $errorNumber Number of the error | |
| string | $errorMessage Description of the error |
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';
| string | $name Session key names as string. |
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.
| mixed | $key The name of the var | |
| mixed | $value The value of the var |
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.
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.
| string | $name Variable name to check for |
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.
| string | $name Session variable to remove |
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.
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.
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
| id | $name string |
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
| mixed | $var The variable path to watch |
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.
| mixed | $name The name of the session variable (or a path as sent to Set.extract) |
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.
| string | $name Variable name to check for |
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
Definition at line 182 of file session.php.
Referenced by SessionHelper::__start().
| valid | ( | ) |
Returns true if session is valid.
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
| mixed | $var The variable path to watch |
Definition at line 348 of file session.php.
References __validateKeys().
| write | ( | $ | name, | |
| $ | value | |||
| ) |
Writes value to given session variable name.
| mixed | $name Name of variable | |
| string | $value Value to write |
Definition at line 385 of file session.php.
References __overwrite(), __validateKeys(), Debugger::exportVar(), Set::extract(), and Set::insert().
| $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().
1.4.7