Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 876 Bytes

File metadata and controls

26 lines (19 loc) · 876 Bytes

SecureCookie

Secure cookies in GoLang

Build Status GoDoc

What's a Sookie?

Sookie lets you create Http Cookies where the data stored is serialized, encrypted and signed. Similarly it allows you to decode Http Cookies with such data.

Example Usage

type testingInterface struct {
    Number int
    OtherInfo string
}

testData := testingInterface{ 10, "info"}
secureCookie, err := NewSecureCookieFromData(key, testData)
secureCookie.HttpCookie // has the http cookie with encrypted contents

decryptedValue := testingInterface{}
// Decode the Cookie from above into decryptedValue
_, err = DecodeHttpCookie(key, secureCookie.HttpCookie, &decryptedValue)