Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigDefault = Config{ Expiration: 24 * time.Hour, CookieName: "session_id", KeyGenerator: utils.UUIDv4, }
ConfigDefault is the default config
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Allowed session duration // Optional. Default value 24 * time.Hour Expiration time.Duration // Storage interface to store the session data // Optional. Default value memory.New() Storage fiber.Storage // Name of the session cookie. This cookie will store session key. // Optional. Default value "session_id". CookieName string // Domain of the CSRF cookie. // Optional. Default value "". CookieDomain string // Path of the CSRF cookie. // Optional. Default value "". CookiePath string // Indicates if CSRF cookie is secure. // Optional. Default value false. CookieSecure bool // Indicates if CSRF cookie is HTTP only. // Optional. Default value false. CookieHTTPOnly bool // Value of SameSite cookie. // Optional. Default value "Lax". CookieSameSite string // KeyGenerator generates the session key. // Optional. Default value utils.UUIDv4 KeyGenerator func() string }
Config defines the config for middleware.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) Regenerate ¶
Regenerate generates a new session id and delete the old one from Storage
Click to show internal directories.
Click to hide internal directories.