$sessionName
$sessionName :
Session handler using the mongodb/mongodb package and MongoDB driver extension.
__construct(\MongoDB\Client $mongo, array $options)
Constructor.
List of available options:
It is strongly recommended to put an index on the expiry_field
for
garbage-collection. Alternatively it's possible to automatically expire
the sessions in the database as described below:
A TTL collections can be used on MongoDB 2.2+ to cleanup expired sessions automatically. Such an index can for example look like this:
db.<session-collection>.ensureIndex(
{ "<expiry-field>": 1 },
{ "expireAfterSeconds": 0 }
)
More details on: http://docs.mongodb.org/manual/tutorial/expire-data/
If you use such an index, you can drop gc_probability
to 0 since
no garbage-collection is required.
\MongoDB\Client | $mongo | A MongoDB\Client instance |
array | $options | An associative array of field options |
When MongoClient or Mongo instance not provided
When "database" or "collection" not provided
createDateTime(integer $seconds = null) : \MongoDate|\MongoDB\BSON\UTCDateTime
Create a date object using the class appropriate for the current mongo connection.
Return an instance of a MongoDate or \MongoDB\BSON\UTCDateTime
integer | $seconds | An integer representing UTC seconds since Jan 1 1970. Defaults to now. |