Documentation ¶
Overview ¶
The signedcookie package implements read-only access to cookies generated by Django's signed_cookies session backend.
Index ¶
Constants ¶
View Source
const DefaultMaxAge = 14 * 24 * time.Hour
Django's default max_age is defined as 2 weeks.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(s Serializer, maxAge time.Duration, secret, cookie string) (map[string]interface{}, error)
Decode returns a map corresponding to the object encoded and signed by the django.contrib.sessions.backends.signed_cookies SessionStore, or an error if the cookie could not be decoded or if signature validation failed.
Types ¶
type Serializer ¶
type Serializer int
Serializer represents the method used to convert a data structure into a string. Currently two serializers are supported, JSON and Pickle.
const ( JSON Serializer = iota Pickle )
Click to show internal directories.
Click to hide internal directories.