ISession

interface OCP\ISession
Interface ISession
wrap PHP’s internal session handling into the ISession interface
Implemented by:OC\Session\CryptoSessionData OC\Session\Session
Source:lib/public/ISession.php#50

Methods

public OCP\ISession::set($key, $value)
Set a value in the session
Source:

lib/public/ISession.php#59

Parameters:
  • $key (string)
  • $value (mixed)
Since:

6.0.0

public OCP\ISession::get($key)
Get a value from the session
Source:

lib/public/ISession.php#68

Parameters:
  • $key (string)
Returns:

mixed should return null if $key does not exist

Since:

6.0.0

public OCP\ISession::exists($key)
Check if a named key exists in the session
Source:

lib/public/ISession.php#77

Parameters:
  • $key (string)
Returns:

bool

Since:

6.0.0

public OCP\ISession::remove($key)
Remove a $key/$value pair from the session
Source:

lib/public/ISession.php#85

Parameters:
  • $key (string)
Since:

6.0.0

public OCP\ISession::clear()
Reset and recreate the session
Source:lib/public/ISession.php#91
Since:6.0.0
public OCP\ISession::close()
Close the session and release the lock
Source:lib/public/ISession.php#97
Since:7.0.0
public OCP\ISession::regenerateId($deleteOldSession=true, $updateToken=false)
Wrapper around session_regenerate_id
Source:

lib/public/ISession.php#107

Parameters:
  • $deleteOldSession (bool) Whether to delete the old associated session file or not.
  • $updateToken (bool) Wheater to update the associated auth token
Returns:

void

Since:

9.0.0, $updateToken added in 14.0.0

public OCP\ISession::getId()
Wrapper around session_id
Source:lib/public/ISession.php#116
Returns:string
Throws:\OCP\Session\Exceptions\SessionNotAvailableException
Since:9.1.0