Great article, thanks. Found one oddity in the implementation here; I was ending up with cookie objects in Mongo that had a 'data' subobject, containing unmerged fields. To resolve this, I run the inbound data on the set method through this function:
serialize = (session) ->
data = {}
for key, value of session
data[key] = value?.toJSON?() or value unless typeof value is 'function'
data
Achievements
9
Karma
0
Total ProTip Views
Charity
Fork and commit to someone's open source project in need
Great article, thanks. Found one oddity in the implementation here; I was ending up with cookie objects in Mongo that had a 'data' subobject, containing unmerged fields. To resolve this, I run the inbound data on the set method through this function: