Back to

Package cookie

Latest Go to latest

The highest tagged major version is v3.

Published: Feb 6, 2020 | License: Apache-2.0 | Module:


func Cookies

func Cookies(block, hash []byte) echo.MiddlewareFunc

Cookies is a middleware function that makes the handlers capable of handling cookies via methods of this package.

type Cookie struct {
	// Name is the name of the cookie.
	Name string

	// Path is path of the cookie.
	Path string

	// MaxAge is the max age of the cookie.
	MaxAge time.Duration

	// HTTPOnly restricts the cookie to HTTP (no javascript access).
	HTTPOnly bool

Cookie is a description of a cookie used for consistent cookie setting and deleting.

func (*Cookie) Exists

func (d *Cookie) Exists(c echo.Context) bool

Exists checks if the cookies exists.

func (*Cookie) Get

func (d *Cookie) Get(c echo.Context, v interface{}) (bool, error)

Get decodes the cookie into the value. Returns false if the cookie is not there.

func (*Cookie) Remove

func (d *Cookie) Remove(c echo.Context)

Remove the cookie with the specified name (if it exists).

func (*Cookie) Set

func (d *Cookie) Set(c echo.Context, v interface{}) error

Set the value of the cookie.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier