-
Couldn't load subscription status.
- Fork 27.3k
feat(ngCookies): Additional parameters for $cookies service (domain, expires, secure) #6335
Conversation
This PR allows setting additional parameters on cookies created by $cookieStore. The changes are only on $browser to avoid major changes.
It seems to me the cookie logic could be somehow moved to $cookies, but I will leave that to someone else.
The `expires` parameter can be specified as integer seconds or as a `Date` object.
The parameters are set as follows:
```
angular.extend($browser.cookieOptions, {
path: '/',
domain: '.example.com',
expires: 3600
});
```
Closes #590, and is an alternative PR to #2459
|
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
|
Sweet need this feature, any info about what version this will be available? |
02dc2aa to
fd2d6c0
Compare
cad9560 to
f294244
Compare
e8dc429 to
e83fab9
Compare
4dd5a20 to
998c61c
Compare
|
+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave here the cookiePath as a fallback, so
- not specifying the path has the same effect like before patch
- this is IMHO good default value; it's easier to specify '' as a option then to pass the basePath every time we set cookie.
'; path=' + typeof opt.path === 'string' ? opt.path : cookiePath,|
This PR is no longer valid given 92c366d |
This PR allows setting additional parameters on cookies created by $cookieStore. The changes are only on $browser to avoid major changes.
It seems to me the cookie logic could be somehow moved to $cookies, but I will leave that to someone else.
The
expiresparameter can be specified as integer seconds or as aDateobject.The parameters are set as follows:
Closes #590, and is an alternative PR to #2459