Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide options to cookie storage #323

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

apiel
Copy link

@apiel apiel commented Jan 10, 2022

Allow user to provide custom options for cookie storage like httpOnly mode or custom expiration date:

const keycloak = new Keycloak(
        { 
            cookies: true,
            cookieOptions: { maxAge: 900000, httpOnly: true },
        },
        {
            realm: 'example',
            // ...
        }
};

@oleaasbo
Copy link

I would like to see this added as well. A workaround for me has been:

		app.use(function (req, res, next) {
			var org = res.cookie;
			res.cookie = function (name, value, options) {
				// Change options here
				org.call(this, name, value, options);
			};
			next()
		})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants