[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/libraries/joomla/session/ -> session.php (summary)

(no description)

Copyright: Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
License: GNU/GPL, see LICENSE.php
Version: $Id: session.php 19338 2010-11-03 14:51:55Z ian $
File Size: 737 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

JSession:: (26 methods):
  __construct()
  __destruct()
  getState()
  getExpire()
  getToken()
  hasToken()
  getName()
  getId()
  getStores()
  isNew()
  get()
  set()
  has()
  clear()
  _start()
  destroy()
  restart()
  fork()
  close()
  _createId()
  _setCookieParams()
  _createToken()
  _setCounter()
  _setTimers()
  _setOptions()
  _validate()


Class: JSession  - X-Ref

Class for managing HTTP sessions

Provides access to session-state values as well as session-level
settings and lifetime management methods.
Based on the standart PHP session handling mechanism it provides
for you more advanced features such as expire timeouts.

__construct( $store = 'none', $options = array()   X-Ref
Constructor

param: string $storage
param: array     $options     optional parameters

__destruct()   X-Ref
Session object destructor


getState()   X-Ref
No description

getExpire()   X-Ref
Get expiration time in minutes

return: integer The session expiration time in minutes

getToken($forceNew = false)   X-Ref
Get a session token, if a token isn't set yet one will be generated.

Tokens are used to secure forms from spamming attacks. Once a token
has been generated the system will check the post request to see if
it is present, if not it will invalidate the session.

param: boolean $forceNew If true, force a new token to be created
return: string The session token

hasToken($tCheck, $forceExpire = true)   X-Ref
Method to determine if a token exists in the session. If not the
session will be set to expired

param: string    Hashed token to be verified
param: boolean    If true, expires the session

getName()   X-Ref
Get session name

return: string The session name

getId()   X-Ref
Get session id

return: string The session name

getStores()   X-Ref
Get the session handlers

return: array An array of available session handlers

isNew()   X-Ref
Check whether this session is currently created

return: boolean $result true on success

get($name, $default = null, $namespace = 'default')   X-Ref
Get data from the session store

param: string $name            Name of a variable
param: mixed  $default         Default value of a variable if not set
param: string     $namespace     Namespace to use, default to 'default'
return: mixed  Value of a variable

set($name, $value, $namespace = 'default')   X-Ref
Set data into the session store

param: string $name          Name of a variable
param: mixed  $value         Value of a variable
param: string     $namespace     Namespace to use, default to 'default'
return: mixed  Old value of a variable

has( $name, $namespace = 'default' )   X-Ref
Check wheter data exists in the session store

param: string     $name         Name of variable
param: string     $namespace     Namespace to use, default to 'default'
return: boolean $result true if the variable exists

clear( $name, $namespace = 'default' )   X-Ref
Unset data from the session store

param: string     $name         Name of variable
param: string     $namespace     Namespace to use, default to 'default'
return: mixed $value the value from session or NULL if not set

_start()   X-Ref
Start a session

Creates a session (or resumes the current one based on the state of the session)

return: boolean $result true on success

destroy()   X-Ref
Frees all session variables and destroys all data registered to a session

This method resets the $_SESSION variable and destroys all of the data associated
with the current session in its storage (file or DB). It forces new session to be
started after this method is called. It does not unset the session cookie.

return: void

restart()   X-Ref
restart an expired or locked session

return: boolean $result true on success

fork()   X-Ref
Create a new session and copy variables from the old one

return: boolean $result true on success

close()   X-Ref
Writes session data and ends session

Session data is usually stored after your script terminated without the need
to call JSession::close(),but as session data is locked to prevent concurrent
writes only one script may operate on a session at any time. When using
framesets together with sessions you will experience the frames loading one
by one due to this locking. You can reduce the time needed to load all the
frames by ending the session as soon as all changes to session variables are
done.


_createId( )   X-Ref
Create a session id

return: string Session ID

_setCookieParams()   X-Ref
Set session cookie parameters


_createToken( $length = 32 )   X-Ref
Create a token-string

param: int $length lenght of string
return: string $id generated token

_setCounter()   X-Ref
Set counter of session usage

return: boolean $result true on success

_setTimers()   X-Ref
Set the session timers

return: boolean $result true on success

_setOptions( &$options )   X-Ref
set additional session options

param: array $options list of parameter
return: boolean $result true on success

_validate( $restart = false )   X-Ref
Do some checks for security reason

- timeout check (expire)
- ip-fixiation
- browser-fixiation

If one check failed, session data has to be cleaned.

param: boolean $restart reactivate session
return: boolean $result true on success



Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1