Beispiel #1
0
func (a *AuthSession) add(s sign.Signer, w http.ResponseWriter) error {
	data, err := s.Sign(a)
	if err != nil {
		return err
	}
	http.SetCookie(w, &http.Cookie{
		Name:    "auth",
		Value:   data,
		Path:    "/",
		Expires: time.Now().AddDate(1, 0, 0),
	})
	return nil
}