[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/session/src/ -> SessionInterface.php (summary)

Part of the Joomla Framework Session Package

Copyright: Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 264 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

SessionInterface:: (23 methods):
  getExpire()
  getName()
  setName()
  getId()
  setId()
  isActive()
  isNew()
  isStarted()
  getToken()
  hasToken()
  get()
  set()
  has()
  remove()
  clear()
  all()
  start()
  destroy()
  restart()
  fork()
  close()
  gc()
  abort()


Interface: SessionInterface  - X-Ref

Interface defining a Joomla! Session object

getExpire()   X-Ref
Get expiration time in seconds

return: integer  The session expiration time in seconds

getName()   X-Ref
Get the session name

return: string  The session name

setName(string $name)   X-Ref
Set the session name

param: string  $name  The session name
return: $this

getId()   X-Ref
Get the session ID

return: string  The session ID

setId(string $id)   X-Ref
Set the session ID

param: string  $id  The session ID
return: $this

isActive()   X-Ref
Check if the session is active

return: boolean

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

return: boolean

isStarted()   X-Ref
Check if the session is started

return: boolean

getToken($forceNew = false)   X-Ref
Get a session token.

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

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

hasToken($token, $forceExpire = true)   X-Ref
Check if the session has the given token.

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

get($name, $default = null)   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
return: mixed  Value of a variable

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

param: string  $name   Name of a variable.
param: mixed   $value  Value of a variable.
return: mixed  Old value of a variable.

has($name)   X-Ref
Check whether data exists in the session store

param: string  $name  Name of variable
return: boolean  True if the variable exists

remove(string $name)   X-Ref
Unset a variable from the session store

param: string  $name  Name of variable
return: mixed   The value from session or NULL if not set

clear()   X-Ref
Clears all variables from the session store

return: void

all()   X-Ref
Retrieves all variables from the session store

return: array

start()   X-Ref
Start a session

return: void

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: boolean

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

return: boolean  True on success

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

return: boolean

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

Session data is usually stored after your script terminated without the need
to call SessionInterface::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.

return: void

gc()   X-Ref
Perform session data garbage collection

return: integer|boolean  Number of deleted sessions on success or boolean false on failure or if the function is unsupported

abort()   X-Ref
Aborts the current session

return: boolean



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer