BCJTI / ng2-cookies

Simple library to deal with cookies in Angular2
64 stars 31 forks source link

Option to disable URL encoding in cookie #47

Closed ayya1987 closed 7 years ago

ayya1987 commented 7 years ago

Please give me a suggestion how to stop url encoding in cooking when i used to store as key value pair.

for ex; i am setting key as 'somepath' and value as '/path/path2/path3' after when i am looking inside browser it is different from actual value it is like %2Fpath%2F% something like this.

Please help me to resolve this.

Bigous commented 7 years ago

Use the UnmanagedCookie (or UnmanagedCookieService) instead of Cookie (or CookieService). It was created to cases like this. It does no treatment on your cookies (neither on key nor on value) and you should care about doing things that can break browser behavior (like putting semi-colon on cookies).

You can use it just like you use the Cookie.