function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shyam NairShyam Nair 

document.cookie is not working on Chrome

Hello everyone,

We have a community build on Lightning Experience. Now when an admin tries to login to community through a contact, we are restricting certain functionalities on basis on RSID cookie value. 

Now to get RSID cookie value we are using document.cookie property in lightning component. This is working in IE but in Chrome its showing as undefined. 

This is happening due to the recent Locker Service changes Salesforce. And the above idea to check whether admin has logged in as a contact was given by developers from Salesforce itself.

Has anyone experienced the same issue and has a solution for the same? Please let me know. 

Thank you.
Lokesh KumarLokesh Kumar
Please disable locker service in your lightning ready sandbox you will not get same in production.

For more, you can find the below-Known Issue acknowledged by Salesforce.

Thanks !
Shyam NairShyam Nair
Hi Lokesh, I see that this issue is already there in production. So switching off locker services in sandboxes is not going to help. Regards, Shyam R. Nair | m. +91-9663555001 |
Lokesh KumarLokesh Kumar
OK, Shyam 

Here you go with the same link.

Thanks !