Documentation ¶
Index ¶
- type SecureCookie
- type Session
- func (s Session) Delete(r *http.Request, key string) error
- func (s Session) Get(r *http.Request, key string) (string, error)
- func (s Session) MultiDelete(r *http.Request, keys []string) error
- func (s Session) MultiSet(r *http.Request, vals map[string]string) error
- func (s Session) Set(r *http.Request, key, value string) error
- func (s Session) Write(r *http.Request, w http.ResponseWriter) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SecureCookie ¶
type SecureCookie struct { Path string Domain string Secure bool HttpOnly bool // contains filtered or unexported fields }
func NewSecureCookie ¶
func NewSecureCookie(hashKey []byte, blockKey []byte) *SecureCookie
Creates a new SecureCookie instance hashKey verifies the authenticity of the cookie using HMAC and should be at least 32 bytes (preferably 32 or 64 bytes) blockKey encrypts the cookie using AES-128, AES-192, or AES-256, and must be 16, 24, or 32 bytes respectively. A nil blockKey disables encryption
func (SecureCookie) Read ¶
func (c SecureCookie) Read(name string, r *http.Request, value interface{}) error
func (SecureCookie) Remove ¶
func (c SecureCookie) Remove(name string, w http.ResponseWriter)
func (SecureCookie) Write ¶
func (c SecureCookie) Write(name string, w http.ResponseWriter, maxAge time.Duration, value interface{}) error
type Session ¶
func NewSession ¶
Creates a new Session instance hashKey verifies the authenticity of the cookie using HMAC and should be at least 32 bytes (preferably 32 or 64 bytes) blockKey encrypts the cookie using AES-128, AES-192, or AES-256, and must be 16, 24, or 32 bytes respectively. A nil blockKey disables encryption
Click to show internal directories.
Click to hide internal directories.