Overview

Namespaces

  • Composer
    • Autoload
  • Guzzle
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Mock
    • Stream
  • Mockery
    • Adapter
      • Phpunit
    • CountValidator
    • Exception
    • Generator
      • StringManipulation
        • Pass
    • Loader
    • Matcher
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP
  • Symfony
    • Component
      • EventDispatcher
        • Debug
        • DependencyInjection
        • Tests
          • Debug
          • DependencyInjection
      • HttpFoundation
        • File
          • Exception
          • MimeType
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
        • Tests
          • File
            • MimeType
          • Session
            • Attribute
            • Flash
            • Storage
              • Handler
              • Proxy
      • Yaml
        • Exception
        • Tests

Classes

  • MemcachedSessionHandler
  • MemcacheSessionHandler
  • MongoDbSessionHandler
  • NativeFileSessionHandler
  • NativeSessionHandler
  • NullSessionHandler
  • PdoSessionHandler
  • WriteCheckSessionHandler
  • Overview
  • Namespace
  • Class
  • Tree

Class MongoDbSessionHandler

MongoDB session handler.

Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler implements SessionHandlerInterface
Namespace: Symfony\Component\HttpFoundation\Session\Storage\Handler
Author: Markus Bachmann markus.bachmann@bachi.biz
Located at Session/Storage/Handler/MongoDbSessionHandler.php
Methods summary
public
# __construct( Mongo|MongoClient $mongo, array $options )

Constructor.

Constructor.

List of available options: * database: The name of the database [required] * collection: The name of the collection [required] * id_field: The field name for storing the session id [default: _id] * data_field: The field name for storing the session data [default: data] * time_field: The field name for storing the timestamp [default: time]

Parameters

$mongo
A MongoClient or Mongo instance
$options
An associative array of field options

Throws

InvalidArgumentException
When MongoClient or Mongo instance not provided
InvalidArgumentException
When "database" or "collection" not provided
public boolean
# open( string $savePath, string $sessionName )

Re-initializes existing session, or creates a new one.

Re-initializes existing session, or creates a new one.

Parameters

$savePath
Save path
$sessionName
Session name, see http://php.net/function.session-name.php

Returns

boolean
true on success, false on failure

Implementation of

SessionHandlerInterface::open()
public boolean
# close( )

Closes the current session.

Closes the current session.

Returns

boolean
true on success, false on failure

Implementation of

SessionHandlerInterface::close()
public boolean
# destroy( string $sessionId )

Destroys a session.

Destroys a session.

Parameters

$sessionId
Session ID, see http://php.net/function.session-id

Returns

boolean
true on success, false on failure

Implementation of

SessionHandlerInterface::destroy()
public boolean
# gc( string|integer $maxlifetime )

Cleans up expired sessions (garbage collection).

Cleans up expired sessions (garbage collection).

Parameters

$maxlifetime
Sessions that have not updated for the last maxlifetime seconds will be removed

Returns

boolean
true on success, false on failure

Implementation of

SessionHandlerInterface::gc()
public boolean
# write( string $sessionId, string $data )

Writes the session data to the storage.

Writes the session data to the storage.

Parameters

$sessionId
Session ID , see http://php.net/function.session-id
$data
Serialized session data to save

Returns

boolean
true on success, false on failure

Implementation of

SessionHandlerInterface::write()
public string
# read( string $sessionId )

Reads the session data.

Reads the session data.

Parameters

$sessionId
Session ID, see http://php.net/function.session-id

Returns

string
Same session data as passed in write() or empty string when non-existent or on failure

Implementation of

SessionHandlerInterface::read()
protected Mongo
# getMongo( )

Return a Mongo instance

Return a Mongo instance

Returns

Mongo
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen