gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

session_options_go1.10.go (720B)


      1 // +build !go1.11
      2 
      3 package sessions
      4 
      5 import (
      6 	gsessions "github.com/gorilla/sessions"
      7 )
      8 
      9 // Options stores configuration for a session or session store.
     10 // Fields are a subset of http.Cookie fields.
     11 type Options struct {
     12 	Path   string
     13 	Domain string
     14 	// MaxAge=0 means no 'Max-Age' attribute specified.
     15 	// MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'.
     16 	// MaxAge>0 means Max-Age attribute present and given in seconds.
     17 	MaxAge   int
     18 	Secure   bool
     19 	HttpOnly bool
     20 }
     21 
     22 func (options Options) ToGorillaOptions() *gsessions.Options {
     23 	return &gsessions.Options{
     24 		Path:     options.Path,
     25 		Domain:   options.Domain,
     26 		MaxAge:   options.MaxAge,
     27 		Secure:   options.Secure,
     28 		HttpOnly: options.HttpOnly,
     29 	}
     30 }