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#46

Methods

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

lib/public/ISession.php#55

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#64

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#73

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#81

Parameters:
  • $key (string)
Since:

6.0.0

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

lib/public/ISession.php#103

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#112
Returns:string
Throws:\OCP\Session\Exceptions\SessionNotAvailableException
Since:9.1.0