Back to Joomla project (class list)

Class Session - list of methods

Class for managing HTTP sessions
Package: Joomla\CMS\Session
Copyright: (C) 2005 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Session/Session.php
Project: Joomla

Method Summary

public
(\Joomla\Session\StorageInterface $store = null, \Joomla\Event\DispatcherInterface $dispatcher = null, array $options = [])

Constructor
Parameters
  • \Joomla\Session\StorageInterface $store A StorageInterface implementation.
  • \Joomla\Event\DispatcherInterface $dispatcher DispatcherInterface for the session to use.
  • array $options Optional parameters. Supported keys include: - name: The session name - id: The session ID - expire: The session lifetime in seconds
Since
  • 1.0
Show source code of this method: __construct Source Code

public static bool
(mixed $method = 'post')

Checks for a form token in the request.
Parameters
  • string $method The request method in which to look for the token key.
Returns
  • bool True if found and valid, false otherwise.
Since
  • 2.5.4
Show source code of this method: checkToken Source Code

public static string
(mixed $forceNew = false)

Method to determine a hash for anti-spoofing variable names
Parameters
  • bool $forceNew If true, force a new token to be created
Returns
  • string Hashed var name
Since
  • 1.6
Show source code of this method: getFormToken Source Code

public static array
()

Get the available session handlers
Returns
  • array An array of available session handlers
Since
  • 4.0.0
Show source code of this method: getHandlers Source Code

public static static
()

Returns the global session object.
Returns
  • static The Session object.
Since
  • 1.5
Deprecated
  • 5.0
Show source code of this method: getInstance Source Code

public mixed
(mixed $name, mixed $default = null)

Get data from the session store
Parameters
  • string $name Name of a variable
  • mixed $default Default value of a variable if not set
Returns
  • mixed Value of a variable
Since
  • 1.5
Show source code of this method: get Source Code

public mixed
(mixed $name, mixed $value = null)

Set data into the session store.
Parameters
  • string $name Name of a variable.
  • mixed $value Value of a variable.
Returns
  • mixed Old value of a variable.
Since
  • 1.5
Show source code of this method: set Source Code

public bool
(mixed $name)

Check whether data exists in the session store
Parameters
  • string $name Name of variable
Returns
  • bool True if the variable exists
Since
  • 1.5
Show source code of this method: has Source Code

public void
()

Clears all variables from the session store
Returns
  • void
Since
  • 1.5
Show source code of this method: clear Source Code

Tags Summary

Since
1.5