LemonLDAPNG / apache-session-mongodb

Implementation of Apache::Session which uses MongoDB as backend
https://metacpan.org/pod/Apache::Session::MongoDB
Other
2 stars 2 forks source link

Substitute $ and . characters in keys before stroring session contents #3

Closed coudot closed 8 years ago

coudot commented 8 years ago

If we try to store a session like this :

{ "keyA" => { "key.B" => "value" } }

We get an error:

(in cleanup) MongoDB::DocumentError: documents for storage cannot contain the '.' character at /usr/local/lib/perl/5.18.2/MongoDB/BSON.pm line 215.

This is explained here: http://stackoverflow.com/questions/12397118/mongodb-dot-in-key-name

As we can't know what would be the data stored, we should substitute forbidden characters in the serialization, and restore them in deserialization.