0

I am using ngCookies for my Angular JS project. I am trying to set samesite option as strict(as mentioned below), but it's not working. Could anyone please help me how can I set samesite for Angular JS cookies?

I tried as per this Angular JS documentation, I see all other options are getting set but the samesite is not getting set as 'strict' in chrome. Reference

MyCookiesService.put('user-details', JSON.stringify(session), {
                        expires: expire.toUTCString(),
                        path: '/',
                        secure: true,
                        samesite: 'strict'
                    });
Nirmala
  • 65
  • 2
  • 10
  • 1
    I suspect the issue would be with Angular JS version(1.6.10) which I am using. samesite option is supported from the version 1.7.1. – Nirmala May 28 '19 at 12:37
  • Are you aware of any way to setting samesite in the older versions of Angular (such Angular Js 1.4.9) – AshD Jun 22 '22 at 16:04

1 Answers1

2

Solved via comment from Nirmala.

My issue required samesite: 'none'. Confirmed code works correctly when upgraded to Angular 1.7.1+

MyCookiesService.put('user-details', JSON.stringify(session), {
                        expires: expire.toUTCString(),
                        path: '/',
                        secure: true,
                        samesite: 'strict'
                    });
nesterenes
  • 184
  • 2
  • 17