$cookieProvider
Configure default attributes for cookies written by the $cookie service.
$cookieProvider configures defaults that are merged into every $cookie.put(),
$cookie.putObject(), and $cookie.remove() call.
Exact signatures live in TypeDoc:
Set Defaults
angular.module("demo", []).config(($cookieProvider) => {
$cookieProvider.defaults = {
path: "/",
secure: true,
samesite: "Lax",
};
});
Use provider defaults for application-wide settings such as cookie path, HTTPS-only behavior, and SameSite policy. Per-call options still override these defaults.
For service usage, see $cookie.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.