cookie

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cookie provides utilities for using HTTP cookies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(w http.ResponseWriter, name, domain string)

Delete removes the named cookie.

func Set

func Set(
	w http.ResponseWriter,
	name string,
	value string,
	domain string,
	mAge time.Duration,
	jsAccess bool,
)

Set creates a cookie on the HTTP response.

If domain is an empty string, the cookie is set for the current host(excluding subdomains) else it is set for the given domain and its subdomains. If mAge <= 0, a session cookie is created. If jsAccess is false, the cookie will be in-accesible to Javascript. In most cases you should set it to false(exceptions are rare, like when setting a csrf cookie)

Types

This section is empty.

Jump to

Keyboard shortcuts

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