You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use mongo_session_store with MongoStore. For some reasons, we are stuck with ruby mongo 1.12 driver, so lastest working version of mongo_session_store is 5.1 (6.0 does not want to work with 1.12).
I've noticed that with every request, new document in database is created. Analysing code I saw these lines:
def self.load(options = {})
options[:data] = options["data"] if options["data"]
new(options)
end
Document fetched from database with e.g. ActionDispatch::Session::MongoStore::Session.collection.find.first is: {"_id"=>"lsn4t6544ngQjAEgofn-dHlMytA", "data"=><BSON::Binary:70311184564240>, "created_at"=>2015-08-18 13:09:19 UTC, "updated_at"=>2015-08-18 13:09:19 UTC}
but using ActionDispatch::Session::MongoStore::Session.where.first, a Session instance is in form:
Hello,
I try to use mongo_session_store with MongoStore. For some reasons, we are stuck with ruby mongo 1.12 driver, so lastest working version of mongo_session_store is 5.1 (6.0 does not want to work with 1.12).
I've noticed that with every request, new document in database is created. Analysing code I saw these lines:
Document fetched from database with e.g. ActionDispatch::Session::MongoStore::Session.collection.find.first is:
{"_id"=>"lsn4t6544ngQjAEgofn-dHlMytA", "data"=><BSON::Binary:70311184564240>, "created_at"=>2015-08-18 13:09:19 UTC, "updated_at"=>2015-08-18 13:09:19 UTC}
but using ActionDispatch::Session::MongoStore::Session.where.first, a Session instance is in form:
Isn't it a bug, that self.load method sets only options[:data] field, ignoring _id, created_and and updated_at (whose are Strings not Symbols)?
I think it causes that Sessions can't be deleted, e.g.:
Mongo session store version 6.0 has the same code for self.load.
Best regards,
Jakub Liput
The text was updated successfully, but these errors were encountered: