Session.php

Summary
Session.php
SessionTable Definition for session
SessionSuperclass representing a saved database as it exists in the database and the associated interfeces.
schemaDefReturns an array describing how the session is stored in the database.
logdebA helper function to print a session-related message to the debug log if the site session debug configuration option is enabled.
openDummy option for saving to file (we don’t do this for privacy and secruity reasons) needed for full PHP adherence.
closeDummy option for saving to file (we don’t do this for privacy and secruity reasons) needed for full PHP adherence.
readFetch the session data for the session with the given $id.
writeWrite the session data for session with given $id as $session_data.
destroyDeletes session with given id $id.
gcFind sessions that have persisted beyond $maxlifetime and delete them.
setSaveHandlerSet our session handler as the handlers for PHP session handling in the context of postActiv.
cleanupStuff to do before the request teardown.

Session

Table Definition for session

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

Table Definition for session

PHP version

Tested with PHP 7

File Authors

Web

Session

Superclass representing a saved database as it exists in the database and the associated interfeces.

Properties

  • __table = ‘session’ - table name
  • id - varchar(32) primary_key not_null
  • session_data - text()
  • created - datetime() not_null
  • modified - timestamp() not_null default_CURRENT_TIMESTAMP
Summary
schemaDefReturns an array describing how the session is stored in the database.
logdebA helper function to print a session-related message to the debug log if the site session debug configuration option is enabled.
openDummy option for saving to file (we don’t do this for privacy and secruity reasons) needed for full PHP adherence.
closeDummy option for saving to file (we don’t do this for privacy and secruity reasons) needed for full PHP adherence.
readFetch the session data for the session with the given $id.
writeWrite the session data for session with given $id as $session_data.
destroyDeletes session with given id $id.
gcFind sessions that have persisted beyond $maxlifetime and delete them.
setSaveHandlerSet our session handler as the handlers for PHP session handling in the context of postActiv.
cleanupStuff to do before the request teardown.

schemaDef

public static function schemaDef()

Returns an array describing how the session is stored in the database.

logdeb

static function logdeb($msg)

A helper function to print a session-related message to the debug log if the site session debug configuration option is enabled.

open

static function open($save_path,
$session_name)

Dummy option for saving to file (we don’t do this for privacy and secruity reasons) needed for full PHP adherence.

close

static function close()

Dummy option for saving to file (we don’t do this for privacy and secruity reasons) needed for full PHP adherence.

read

static function read($id)

Fetch the session data for the session with the given $id.

write

static function write($id,
$session_data)

Write the session data for session with given $id as $session_data.

destroy

static function destroy($id)

Deletes session with given id $id.

gc

static function gc($maxlifetime)

Find sessions that have persisted beyond $maxlifetime and delete them.  This will be limited by config[‘sessions’][‘gc_limit’] - it won’t delete more than the number of sessions specified there at a single pass.

setSaveHandler

static function setSaveHandler()

Set our session handler as the handlers for PHP session handling in the context of postActiv.

Returns

  • mixed Result - result given by PHP of setting the handlers.

cleanup

static function cleanup()

Stuff to do before the request teardown.

public static function schemaDef()
Returns an array describing how the session is stored in the database.
static function logdeb($msg)
A helper function to print a session-related message to the debug log if the site session debug configuration option is enabled.
static function open($save_path,
$session_name)
Dummy option for saving to file (we don’t do this for privacy and secruity reasons) needed for full PHP adherence.
static function close()
Dummy option for saving to file (we don’t do this for privacy and secruity reasons) needed for full PHP adherence.
static function read($id)
Fetch the session data for the session with the given $id.
static function write($id,
$session_data)
Write the session data for session with given $id as $session_data.
static function destroy($id)
Deletes session with given id $id.
static function gc($maxlifetime)
Find sessions that have persisted beyond $maxlifetime and delete them.
static function setSaveHandler()
Set our session handler as the handlers for PHP session handling in the context of postActiv.
static function cleanup()
Stuff to do before the request teardown.