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
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
// rails uses a random iv, so this should be fine: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/message_encryptor.rb#L172
115
+
_, err=rand.Read(iv)
116
+
iferr!=nil {
117
+
return
118
+
}
119
+
120
+
cfb:=cipher.NewCBCEncrypter(c, iv)
121
+
data:=make([]byte, len(padded))
122
+
cfb.CryptBlocks(data, padded)
123
+
124
+
cookie=encodeCookieData(data, iv)
125
+
126
+
return
127
+
}
128
+
129
+
// EncryptSignedCookie encrypts and signs session to produce a cookie that rails can read
// map[flash:map[discard:[] flashes:map[notice:Welcome! You have signed up successfully.]] session_id:b85897340bfedc7e03b7e9479c271439 _csrf_token:dTDcQiGuEE8n6KUQmXNhIoXsLQJlqrBPUAsspGMpkdg= warden.user.user.key:[[1] $2a$11$6omJ7/e3Ni7Pl7jZbCdDBu]]
plainjson=`{"session_id":"b85897340bfedc7e03b7e9479c271439","_csrf_token":"dTDcQiGuEE8n6KUQmXNhIoXsLQJlqrBPUAsspGMpkdg=","warden.user.user.key":[[1],"$2a$11$6omJ7/e3Ni7Pl7jZbCdDBu"],"flash":{"discard":[],"flashes":{"notice":"Welcome! You have signed up successfully."}}}`
0 commit comments