Class MongoDB

Summary

Fully Qualified Name: Zend\Session\SaveHandler\MongoDB
Implements: SaveHandlerInterface

Description

MongoDB session save handler

Methods

Name Description Defined By
__construct() Constructor MongoDB
close() Close session MongoDB
destroy() Destroy session MongoDB
gc() Garbage collection MongoDB
open() Open session MongoDB
read() Read session data MongoDB
write() Write session data MongoDB

Method Details

__construct()

Constructor

Parameter Name Type Description
$mongoClient \MongoClient
$options \MongoDBOptions

Returns:

close()

Close session

Returns: bool

destroy()

Destroy session

Parameter Name Type Description
$id string

Returns: bool

gc()

Garbage collection

Note: MongoDB 2.2+ supports TTL collections, which may be used in place of this method by indexing the "modified" field with an "expireAfterSeconds" option. Regardless of whether TTL collections are used, consider indexing this field to make the remove query more efficient.

Parameter Name Type Description
$maxlifetime int

Returns: bool

open()

Open session

Parameter Name Type Description
$savePath string
$name string

Returns: bool

read()

Read session data

Parameter Name Type Description
$id string

Returns: string

write()

Write session data

Parameter Name Type Description
$id string
$data string

Returns: bool

Top