session icon indicating copy to clipboard operation
session copied to clipboard

MongoDB Json

Open henriqueoliveira opened this issue 10 years ago • 2 comments

On mongodb, the session data can be saved using Json, so we can view all the data with db.session.find() command.

Should be nice to have a field for Domain, than the session data will be separeted for each domain

If you need help, let me know, i can fork and do some stuff as pull request

Thanks

henriqueoliveira avatar May 26 '14 04:05 henriqueoliveira

Is true that using JSON the data will become more human readable but the current implementation of the Mongo storage takes a general approach and makes no assumption regarding what kind of data a user will store into a session.

In most of the cases, users will store strings, numbers or arrays, but some users (and I'm one of them) might want to store other kind of data, like PHP objects or anonymous functions (using opis/closure).

I haven't tested yet, but i'm pretty sure that by using JSON we won't be able to store other data types beside strings, booleans, arrays, key-value dictionaries and numbers. Please, feel free to fork this repository if you would like to give it a try.

msarca avatar May 27 '14 12:05 msarca

I Think that the MongoCollection::insert method will do the Job for you, not sure

http://www.php.net/manual/pt_BR/mongocollection.insert.php

But your answer is fare enought, i think there is no problem to keep this way

henriqueoliveira avatar May 27 '14 22:05 henriqueoliveira