@@ -153,14 +153,7 @@ func NewOptions() *Options {
153153 RealClientIPHeader: "X-Real-IP",
154154 ForceHTTPS: false,
155155 DisplayHtpasswdForm: true,
156− Cookie: CookieOptions{
157− Name: "_oauth2_proxy",
158− Secure: true,
159− HTTPOnly: true,
160− Expire: time.Duration(168) * time.Hour,
161− Refresh: time.Duration(0),
162− Path: "/",
163− },
156+ Cookie: defaultCookieOptions(),
164157 Session: SessionOptions{
165158 Type: "cookie",
166159 },
@@ -245,17 +238,6 @@ func NewFlagSet() *pflag.FlagSet {
245238 flagSet.String("ping-path", "/ping", "the ping endpoint that can be used for basic health checks")
246239 flagSet.String("ping-user-agent", "", "special User-Agent that will be used for basic health checks")
247240 flagSet.Bool("proxy-websockets", true, "enables WebSocket proxying")
248−
249− flagSet.String("cookie-name", "_oauth2_proxy", "the name of the cookie that the oauth_proxy creates")
250− flagSet.String("cookie-secret", "", "the seed string for secure cookies (optionally base64 encoded)")
251− flagSet.StringSlice("cookie-domain", []string{}, "Optional cookie domains to force cookies to (ie: `.yourcompany.com`). The longest domain matching the request's host will be used (or the shortest cookie domain if there is no match).")
252− flagSet.String("cookie-path", "/", "an optional cookie path to force cookies to (ie: /poc/)*")
253− flagSet.Duration("cookie-expire", time.Duration(168)*time.Hour, "expire timeframe for cookie")
254− flagSet.Duration("cookie-refresh", time.Duration(0), "refresh the cookie after this duration; 0 to disable")
255− flagSet.Bool("cookie-secure", true, "set secure (HTTPS) cookie flag")
256− flagSet.Bool("cookie-httponly", true, "set HttpOnly cookie flag")
257− flagSet.String("cookie-samesite", "", "set SameSite cookie attribute (ie: \"lax\", \"strict\", \"none\", or \"\"). ")
258−
259241 flagSet.String("session-store-type", "cookie", "the session storage provider to use")
260242 flagSet.String("redis-connection-url", "", "URL of redis server for redis session storage (eg: redis://HOST[:PORT])")
261243 flagSet.Bool("redis-use-sentinel", false, "Connect to redis via sentinels. Must set --redis-sentinel-master-name and --redis-sentinel-connection-urls to use this feature")
@@ -292,6 +274,7 @@ func NewFlagSet() *pflag.FlagSet {
292274
293275 flagSet.String("user-id-claim", "email", "which claim contains the user ID")
294276
277+ flagSet.AddFlagSet(cookieFlagSet())
295278 flagSet.AddFlagSet(loggingFlagSet())
296279
297280 return flagSet