Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
trusted-set-cookie
1 parent 28d2326 commit 3a2bb62Copy full SHA for 3a2bb62
src/js/resources/cookie.js
@@ -135,7 +135,15 @@ export function setCookieFn(
135
136
if ( trusted ) {
137
if ( options.domain ) {
138
- cookieParts.push(`; domain=${options.domain}`);
+ let domain = options.domain;
139
+ if ( /^\/.+\//.test(domain) ) {
140
+ const reDomain = new RegExp(domain.slice(1, -1));
141
+ const match = reDomain.exec(document.location.hostname);
142
+ domain = match ? match[0] : undefined;
143
+ }
144
+ if ( domain ) {
145
+ cookieParts.push(`; domain=${domain}`);
146
147
}
148
cookieParts.push('; Secure');
149
} else if ( /^__(Host|Secure)-/.test(name) ) {
0 commit comments