More powerful $cookies service
I want to set a cookie on the root path / so it's available everywhere on the domain.
But the $cookies service only accepts name and value, and always sets the cookie path to the current page via self.baseHref().
Could the $cookies service be extended to provide access to additional cookie properties like path, expires, domain and secure?
I quite like the API of the jquery.cookie plugin: https://github.com/carhartl/jquery-cookie#usage. It keeps the common name=value use case simple and allows to set additional cookie properties via a third options object parameter.
I'm not very proficient in Javascript but I might try to implement something over the weekend.
:+1: , but a 2 year old outstanding issue with this many bumps? Probably best to find another solution.
@joseym I can imagine most people found a workaround 'till now. This issues is in the Backlog milestone, which implies it would get 'fixed' sometime in the future.
** Later edit: ** PR would be helpful, albeit I don't need this now. Been using https://github.com/grevory/angular-local-storage with great success.
+1
+1.
Doesn't make much sense to have cookies, then to skip every single feature of them.
+1
:+1:
+1 ... Can't believe this cookie API is this poor edit: just found https://github.com/ivpusic/angular-cookie
@bixibu I ended up using the same library and it works well.
Some have alluded to the existence of other libraries as the solution, however I believe (as I think most others do as well) that if angular is going to have its own cookie module, it should be complete, or not exist at all.
Most on-boarders would assume that the cookie module that comes from the creators of the framework they're using would be the best option.
Its simply misleading.
:+1: No reason to not have the options
+1
+1
+1
+1
Also +1. Seriously.
+1
+1 - at least allow for setting path
+1 I actually didn't believe the docs to be accurate on this... but they are
one more for the pile: :+1:
I would have started work on this but this seems to be already be addressed by pull requests #6335 submitted in February and a sequel #6507 in March. Which sadly havent been merged...
one more +1