---
schema_version: "1"
id: 4c51d0d2a44d0083879c31806bb7bb0d6749957f265a629037b64b0a80cf4022
title: Enable Lightning Web Security in an Org
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwc/lightning-components-security/guides/lws/lws-enable.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-enable.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: cf1a0c028517a43593cc9c2fd57e29184da6f081a03cac2ece44f64a9902ca9a
products:
  - Security for Lightning Components
  - lwc
---
# Enable Lightning Web Security in an Org

To determine whether to enable Lightning Web Security (LWS) in your production org, see [When to Enable Lightning Web Security](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-when.md). First test LWS in a sandbox environment, and then in production.

**important:** New orgs have Lightning Web Security for Lightning web components and Aura components enabled by default. If you create an org from a template, then that org inherits the LWS setting of the template.

If you plan to populate a new org with preexisting or packaged Lightning components, be sure to first test in a sandbox environment with LWS enabled. See [Workflow to Test Your Components with Lightning Web Security](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-test-workflow.md).

If your org contains Experience Cloud sites, see [Experience Builder Sites and LWS](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-lms-ec.md) before enabling LWS.

To use Lightning Web Security in an org:

1.  From Setup, in the Quick Find box, enter `Session`, and then select **Session Settings**.
2.  On the Session Settings page, select **Use Lightning Web Security for Lightning web components and Aura components** and save.
3.  To ensure the correct files are loaded in the browser, clear your browser cache after enabling or disabling Lightning Web Security. If you suspect that the correct security architecture is not in effect, see [Delayed Enabling or Disabling of LWS](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-caching.md).

![Session Settings page with Lightning Web Security selected](https://developer.salesforce.com/media/setup_lwsec_enable.png)

To report issues, give feedback, or ask questions about Lightning Web Security, go to the [Lightning Components Development group](https://sfdc.co/NextGenWebSecurity) on Trailhead.

**important:** LWS relies on [Stricter CSP](https://developer.salesforce.com/docs/platform/lightning-components-security/content-security-policy/content-security-policy-stricter.md) to fully implement its security measures. When LWS is enabled, we strongly advise that you keep the Enable Stricter Content Security Policy setting enabled.

**See Also**

- [Enable and Disable LWS in Scratch Orgs](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/lws-enable-scratch-orgs.md)
- [Salesforce Help: Lightning Web Security FAQ](https://help.salesforce.com/s/articleView?id=000363550&type=1)
