Top 0.1% dependent packages on proxy.golang.org
Top 0.1% dependent repos on proxy.golang.org
Top 2.2% forks on proxy.golang.org
Top 0.1% docker downloads on proxy.golang.org
proxy.golang.org : github.com/gorilla/securecookie
Package securecookie encodes and decodes authenticated and optionally encrypted cookie values. Secure cookies can't be forged, because their values are validated using HMAC. When encrypted, the content is also inaccessible to malicious eyes. To use it, first create a new SecureCookie instance: The hashKey is required, used to authenticate the cookie value using HMAC. It is recommended to use a key with 32 or 64 bytes. The blockKey is optional, used to encrypt the cookie value -- set it to nil to not use encryption. If set, the length must correspond to the block size of the encryption algorithm. For AES, used by default, valid lengths are 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256. Strong keys can be created using the convenience function GenerateRandomKey(). Once a SecureCookie instance is set, use it to encode a cookie value: Later, use the same SecureCookie instance to decode and validate a cookie value: We stored a map[string]string, but secure cookies can hold any value that can be encoded using encoding/gob. To store custom types, they must be registered first using gob.Register(). For basic types this is not needed; it works out of the box.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/gorilla/securecookie
Keywords:
cookie
, go
, securecookie
License: BSD-3-Clause
Latest release: over 1 year ago
First release: about 8 years ago
Namespace: github.com/gorilla
Dependent packages: 2,561
Dependent repositories: 16,980
Stars: 610 on GitHub
Forks: 148 on GitHub
Docker dependents: 758
Docker downloads: 4,992,741,166
See more repository details: repos.ecosyste.ms
Last synced: about 20 hours ago