Secure cookies in GoLang
Sookie lets you create Http Cookies where the data stored is serialized, encrypted and signed. Similarly it allows you to decode Http Cookies with such data.
type testingInterface struct {
Number int
OtherInfo string
}
testData := testingInterface{ 10, "info"}
secureCookie, err := NewSecureCookieFromData(key, testData)
secureCookie.HttpCookie // has the http cookie with encrypted contents
decryptedValue := testingInterface{}
// Decode the Cookie from above into decryptedValue
_, err = DecodeHttpCookie(key, secureCookie.HttpCookie, &decryptedValue)