Skip to content

Commit 6035eff

Browse files
committed
merged branch jmikola/2.2-mongodb-session (PR symfony#5927)
This PR was merged into the master branch. Commits ------- ded3a83 [HttpFoundation] Document MongoDbSessionHandler changes Discussion ---------- [HttpFoundation] Document MongoDbSessionHandler changes ``` Bug fix: no Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: - Todo: - License of the code: MIT Documentation PR: - ``` Documentation changes for symfony#5916 --------------------------------------------------------------------------- by Baachi at 2012-11-06T20:41:11Z :+1:
2 parents 4f1547a + ded3a83 commit 6035eff

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

UPGRADE-2.2.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
UPGRADE FROM 2.1 to 2.2
22
=======================
33

4+
### HttpFoundation
5+
6+
* The MongoDbSessionHandler default field names and timestamp type have changed.
7+
8+
The `sess_` prefix was removed from default field names. The session ID is
9+
now stored in the `_id` field by default. The session date is now stored as a
10+
`MongoDate` instead of `MongoTimestamp`, which also makes it possible to use
11+
TTL collections in MongoDB 2.2+ instead of relying on the `gc()` method.
12+
413
#### Deprecations
514

615
* The `Request::splitHttpAcceptHeader()` is deprecated and will be removed in 2.3.

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
3636
/**
3737
* Constructor.
3838
*
39+
* List of available options:
40+
* * database: The name of the database [required]
41+
* * collection: The name of the collection [required]
42+
* * id_field: The field name for storing the session id [default: _id]
43+
* * data_field: The field name for storing the session data [default: data]
44+
* * time_field: The field name for storing the timestamp [default: time]
45+
*
3946
* @param \Mongo $mongo A "Mongo" instance
4047
* @param array $options An associative array of field options
4148
*

0 commit comments

Comments
 (0)