Search code examples
angulartypescriptangular2-cookie

How to set cookie object using CookieOptions(earlier CookieOptionsArgs) for setting cookie for other/parent domain?


Is angular2-cookie already Depricated? if yes how to set cookie object using CookieOptions(earlier CookieOptionsArgs) for setting cookie for other/parent domain?


Solution

  • Yes As the angular version has upgraded the new ngx-cookie has replaced earlier angular 2 cookie.You can set the cookie for parent domain using CookieOptions in ngx-cookie by setting the domain param provided.Hope it helps.

    Just make sure you are setting cookie of parent domain from subdomain.