func NewGCM(key []byte) (*SafeCookie, error) {
	b, err := aes.NewCipher(key)
	if err != nil {
		return nil, err
	}
	gcm, err := cipher.NewGCM(b)
	if err != nil {
		return nil, err
	}
	return &SafeCookie{AEAD: gcm}, nil
}
NewGCM returns a new AES-GCM-based SafeCookie instance given a 128-, 192-, or
256-bit key.
package safecookie
import (
	"crypto/aes"
	"crypto/cipher"
	"crypto/rand"
	"encoding/base64"
	"errors"
	"net/http"
)
var (
	ErrInvalidCookie = errors.New("invalid cookie")
)
type SafeCookie struct {
	AEAD cipher.AEAD
}