Revert "Update securecookie.go"

This reverts commit f14b1ebae2.
This commit is contained in:
Hank Shen 2023-12-06 11:05:58 +08:00
parent f14b1ebae2
commit 3faf6fc167

View file

@ -118,8 +118,6 @@ type Codec interface {
Decode(name, value string, dst interface{}, maxAge ...int) error Decode(name, value string, dst interface{}, maxAge ...int) error
} }
var DefaultMaxLength = 1024 * 1024 // 1M
// New returns a new SecureCookie. // New returns a new SecureCookie.
// //
// hashKey is required, used to authenticate values using HMAC. Create it using // hashKey is required, used to authenticate values using HMAC. Create it using
@ -140,7 +138,7 @@ func New(hashKey, blockKey []byte) *SecureCookie {
blockKey: blockKey, blockKey: blockKey,
hashFunc: sha256.New, hashFunc: sha256.New,
maxAge: 86400 * 30, maxAge: 86400 * 30,
maxLength: DefaultMaxLength, maxLength: 4096,
sz: GobEncoder{}, sz: GobEncoder{},
} }
if len(hashKey) == 0 { if len(hashKey) == 0 {