Skip to content

Commit 8132904

Browse files
authored
Rename MRT_DISABLE_HTTPONLY_SESSION_COOKIES to MRT_ENABLE_HTTPONLY_SESSION_COOKIES (#3723)
* Rename MRT_DISABLE_HTTPONLY_SESSION_COOKIES to MRT_ENABLE_HTTPONLY_SESSION_COOKIES
1 parent a461501 commit 8132904

File tree

16 files changed

+40
-25
lines changed

16 files changed

+40
-25
lines changed

packages/pwa-kit-create-app/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## [Unreleased]
22
- Add configuration flag `disableHttpOnlySessionCookies` to `ssrParameters` [#3635](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3635)
33
- Add `x-site-id` request header to read HttpOnly cookies on the server [#3700](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3700)
4+
- Rename the configuration flag `disableHttpOnlySessionCookies` to `enableHttpOnlySessionCookies` [#3723](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3723)
45

56
## v3.17.0-dev
67
- Clear verdaccio npm cache during project generation [#3652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3652)

packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ module.exports = {
188188
ssrParameters: {
189189
ssrFunctionNodeVersion: '24.x',
190190
// Store the session cookies as HttpOnly for enhanced security.
191-
disableHttpOnlySessionCookies: false,
191+
enableHttpOnlySessionCookies: true,
192192
proxyConfigs: [
193193
{
194194
host: '{{answers.project.commerce.shortCode}}.api.commercecloud.salesforce.com',

packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/components/_app-config/index.jsx.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ const AppConfig = ({children, locals = {}}) => {
107107
privateClientProxyEndpoint={slasPrivateClientProxyEndpoint}
108108
// Uncomment 'hybridAuthEnabled' if the current site has Hybrid Auth enabled. Do NOT set this flag for hybrid storefronts using Plugin SLAS.
109109
// hybridAuthEnabled={true}
110+
useHttpOnlySessionCookies={
111+
typeof window !== 'undefined'
112+
? window.__MRT_ENABLE_HTTPONLY_SESSION_COOKIES__ === 'true'
113+
: process.env.MRT_ENABLE_HTTPONLY_SESSION_COOKIES === 'true'
114+
}
110115
>
111116
<MultiSiteProvider site={locals.site} locale={locals.locale} buildUrl={locals.buildUrl}>
112117
<StoreLocatorProvider config={storeLocatorConfig}>

packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/app/components/_app-config/index.jsx.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ const AppConfig = ({children, locals = {}}) => {
108108
privateClientProxyEndpoint={slasPrivateClientProxyEndpoint}
109109
// Uncomment 'hybridAuthEnabled' if the current site has Hybrid Auth enabled. Do NOT set this flag for hybrid storefronts using Plugin SLAS.
110110
// hybridAuthEnabled={true}
111+
useHttpOnlySessionCookies={
112+
typeof window !== 'undefined'
113+
? window.__MRT_ENABLE_HTTPONLY_SESSION_COOKIES__ === 'true'
114+
: process.env.MRT_ENABLE_HTTPONLY_SESSION_COOKIES === 'true'
115+
}
111116
>
112117
<MultiSiteProvider site={locals.site} locale={locals.locale} buildUrl={locals.buildUrl}>
113118
<StoreLocatorProvider config={storeLocatorConfig}>

packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ module.exports = {
184184
ssrParameters: {
185185
ssrFunctionNodeVersion: '24.x',
186186
// Store the session cookies as HttpOnly for enhanced security.
187-
disableHttpOnlySessionCookies: false,
187+
enableHttpOnlySessionCookies: true,
188188
proxyConfigs: [
189189
{
190190
host: '{{answers.project.commerce.shortCode}}.api.commercecloud.salesforce.com',

packages/pwa-kit-dev/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## [Unreleased]
22
- Add configuration flag `disableHttpOnlySessionCookies` to `ssrParameters` [#3635](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3635)
33
- Fix issue to correctly set the environment variable `MRT_DISABLE_HTTPONLY_SESSION_COOKIES` [#3680](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3680)
4+
- Rename the configuration flag `disableHttpOnlySessionCookies` to `enableHttpOnlySessionCookies` [#3723](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3723)
45

56
## v3.17.0-dev
67
- Update jest, archiver and remove rimraf dependencies [#3663](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3663)

packages/pwa-kit-dev/bin/pwa-kit-dev.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,16 @@ const main = async () => {
253253
error('Could not determine app entrypoint.')
254254
process.exit(1)
255255
}
256-
// Load config to get envBasePath and disableHttpOnlySessionCookies from ssrParameters for local development
256+
// Load config to get envBasePath and enableHttpOnlySessionCookies from ssrParameters for local development
257257
// This mimics how MRT sets the system environment variable
258258
const config = getConfig() || {}
259-
const disableHttpOnlySessionCookies =
260-
config.ssrParameters?.disableHttpOnlySessionCookies ?? true
259+
const enableHttpOnlySessionCookies =
260+
config.ssrParameters?.enableHttpOnlySessionCookies ?? false
261261
execSync(`${babelNode} ${inspect ? '--inspect' : ''} ${babelArgs} ${entrypoint}`, {
262262
env: {
263263
...process.env,
264264
...(noHMR ? {HMR: 'false'} : {}),
265-
MRT_DISABLE_HTTPONLY_SESSION_COOKIES: String(disableHttpOnlySessionCookies)
265+
MRT_ENABLE_HTTPONLY_SESSION_COOKIES: String(enableHttpOnlySessionCookies)
266266
}
267267
})
268268
})

packages/pwa-kit-react-sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- Update test setup for Jest 29 compatibility [#3663](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3663)
33
- Add Node 24 support. Drop Node 16 support [#3652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3652)
44
- Add configuration flag `disableHttpOnlySessionCookies` to `ssrParameters` [#3635](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3635)
5+
- Rename the configuration flag `disableHttpOnlySessionCookies` to `enableHttpOnlySessionCookies` [#3723](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3723)
56

67
## v3.16.0 (Feb 12, 2026)
78

packages/pwa-kit-react-sdk/src/ssr/server/react-rendering.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ const renderApp = (args) => {
365365
__CONFIG__: config,
366366
__PRELOADED_STATE__: appState,
367367
__ERROR__: error,
368-
__MRT_DISABLE_HTTPONLY_SESSION_COOKIES__: process.env.MRT_DISABLE_HTTPONLY_SESSION_COOKIES,
368+
__MRT_ENABLE_HTTPONLY_SESSION_COOKIES__: process.env.MRT_ENABLE_HTTPONLY_SESSION_COOKIES,
369369
// `window.Progressive` has a long history at Mobify and some
370370
// client-side code depends on it. Maintain its name out of tradition.
371371
Progressive: getWindowProgressive(req, res)

packages/pwa-kit-runtime/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- Add HttpOnly session cookies for SLAS private client proxy [#3680](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3680)
33
- Handle logout when HttpOnly session cookies is enabled [#3699](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3699)
44
- Add `x-site-id` request header to read HttpOnly cookies on the server [#3700](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3700)
5+
- Rename the configuration flag `disableHttpOnlySessionCookies` to `enableHttpOnlySessionCookies` [#3723](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3723)
56

67
## v3.17.0-dev
78
- Add Node 24 support. Migrate deprecated Node.js `url.parse()` and `url.format()` to the WHATWG `URL` [#3652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3652)

0 commit comments

Comments
 (0)