signedcookie

package
v0.0.0-...-189ea69 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2014 License: MIT Imports: 12 Imported by: 0

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL