func (f *Factory) GetSessionCookie(s string) string {
	var sb strings.Builder
	sb.WriteString(fmt.Sprintf("%s=%s;", f.SessionID, s))
	if f.config.Domain != "" {
		sb.WriteString(fmt.Sprintf(" Domain=%s;", f.config.Domain))
	}
	sb.WriteString(" Path=/;")
	if !f.config.Insecure {
		sb.WriteString(" Secure; HttpOnly;")
	}
	return sb.String()
}
GetSessionCookie return cookie holding session information
package cookie
import (
	"fmt"
	"strings"
)
type Config struct {
	Domain   string `json:"domain,omitempty" xml:"domain,omitempty" yaml:"domain,omitempty"`
	Path     string `json:"path,omitempty" xml:"path,omitempty" yaml:"path,omitempty"`
	Lifetime int    `json:"lifetime,omitempty" xml:"lifetime,omitempty" yaml:"lifetime,omitempty"`
	Insecure bool   `json:"insecure,omitempty" xml:"insecure,omitempty" yaml:"insecure,omitempty"`
	SameSite string `json:"same_site,omitempty" xml:"same_site,omitempty" yaml:"same_site,omitempty"`
}
type Factory struct {
	config    *Config
	Referer   string `json:"referer,omitempty" xml:"referer,omitempty" yaml:"referer,omitempty"`
	SessionID string `json:"session_id,omitempty" xml:"session_id,omitempty" yaml:"session_id,omitempty"`
	SandboxID string `json:"sandbox_id,omitempty" xml:"sandbox_id,omitempty" yaml:"sandbox_id,omitempty"`
}
func NewFactory(c *Config) (*Factory, error) {
	f := &Factory{}
	if c == nil {
		f.config = &Config{}
	} else {
		f.config = c
	}
	f.Referer = "AUTHP_REDIRECT_URL"
	f.SessionID = "AUTHP_SESSION_ID"
	f.SandboxID = "AUTHP_SANDBOX_ID"
	switch strings.ToLower(f.config.SameSite) {
	case "":
	case "lax", "strict", "none":
		f.config.SameSite = strings.Title(f.config.SameSite)
	default:
		return nil, fmt.Errorf("the SameSite cookie attribute %q is invalid", f.config.SameSite)
	}
	return f, nil
}
func (f *Factory) GetCookie(k, v string) string {
	var sb strings.Builder
	sb.WriteString(k + "=" + v + ";")
	if f.config.Domain != "" {
		sb.WriteString(fmt.Sprintf(" Domain=%s;", f.config.Domain))
	}
	if f.config.Path != "" {
		sb.WriteString(fmt.Sprintf(" Path=%s;", f.config.Path))
	} else {
		sb.WriteString(" Path=/;")
	}
	if f.config.Lifetime != 0 {
		sb.WriteString(fmt.Sprintf(" Max-Age=%d;", f.config.Lifetime))
	}
	if f.config.SameSite != "" {
		sb.WriteString(fmt.Sprintf(" SameSite=%s;", f.config.SameSite))
	}
	if !f.config.Insecure {
		sb.WriteString(" Secure; HttpOnly;")
	}
	return sb.String()
}