Figured it out. I updated the EncodeMulti function like so:
func EncodeMulti(name string, value interface{},
codecs ...Codec) (string, error) {
for _, codec := range codecs {
if encoded, err := codec.Encode(name, value); err == nil {
return encoded, nil
} else {
return "", err // added this line
}
}
return "", errors.New("securecookie: the value could not be encoded")
}
The nested error output that the encryption string was too long (even though I had the lib generate it for me). This would be a handy error for many peeps to receive, I’m sure.
Cheers,
Lee