Improve this Doc View Source

Use `$cookiesProvider` to change the default behavior of the $cookies service.

## Properties

- ### `defaults`

  | Object containing default options to pass when setting cookies. The object may have following properties: path - `{string}` - The cookie will be available only for this path and its sub-paths. By default, this would be the URL that appears in your base tag. domain - `{string}` - The cookie will be available only for this domain and its sub-domains. For obvious security reasons the user agent will not accept the cookie if the current domain is not a sub domain or equals to the requested domain. expires - `{string|Date}` - String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT" or a Date object indicating the exact date/time this cookie will expire. secure - `{boolean}` - The cookie will be available only in secured connection. Note: by default the address that appears in your `<base>` tag will be used as path. This is important so that cookies will be visible for all routes in case html5mode is enabled