Haskell library to decrypt Ruby on Rails sessions in order to allow you to share them between Ruby on Rails and Haskell web applications.
-- | Read session id from encrypted Rails cookie on the filesystem.
example :: FilePath -> IO (Maybe ByteString)
example path = do
rawCookie <- BS.readFile path
let appSecret = mkSecretKeyBase "development_secret_token"
let cookie = mkCookie rawCookie
case decodeEither Nothing appSecret cookie of
Left _ ->
pure Nothing
Right rubyObject ->
pure $ sessionId rubyObject
See more in Spec.hs.
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin my-new-feature
). - Create new Pull Request.