mozilla / node-client-sessions

secure sessions stored in cookies
Mozilla Public License 2.0
759 stars 104 forks source link

Manually decrypt cookie? #96

Closed mattfordham closed 9 years ago

mattfordham commented 9 years ago

I am attempting to incorporate integration tests into an application using this module. As the testing system (CasperJS) has no awareness of the back-end, I can't easily decrypt the cookies for testing.

I can access the cookies and know the secret used on the server-side. With those two items in hand, how can I decrypt the cookies (in order to ensure their contents are as expected and use them as input for further tests)?

Thanks!

seanmonstar commented 9 years ago

There's a util property on the exported module that includes encode and decode methods.

mattfordham commented 9 years ago

Oh cool. I'll give that a go!