1 Answer
- Newest
- Most votes
- Most comments
1
I assume you are using PHP to send cookie to viewer. When you sent the set-cookie response header, you can specify the path it applies to
From PHP set-cookie
path
The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain. If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.
So you will generate 2 signed cookies and set it accordingly.
<?php
$arr_cookie_options1 = array (
'expires' => time() + 60*60*24*30,
'path' => '/path1/',
'domain' => '.example.com', // leading dot for compatibility or use subdomain
'secure' => true, // or false
'httponly' => true, // or false
'samesite' => 'None' // None || Lax || Strict
);
setcookie('CloudFront-Expires', 'SignedCookie Value1', $arr_cookie_options1);
$arr_cookie_options2 = array (
'expires' => time() + 60*60*24*30,
'path' => '/path2/',
'domain' => '.example.com', // leading dot for compatibility or use subdomain
'secure' => true, // or false
'httponly' => true, // or false
'samesite' => 'None' // None || Lax || Strict
);
setcookie('CloudFront-Expires', 'SignedCookierValue2', $arr_cookie_options2);
?>
Will need it to test though
Relevant content
- asked 2 years ago
- asked 2 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
I'm not sure what you mean,
What I'm trying to say is that it's possible to support multiple resources like this:
note that to get the cookies I have to make a call to API gateway
I assume you are using PHP to set user cookie. Have updated my post. Hope this clarifies