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.

https://success.salesforce.com/issues_view?id=a1p3A0000001BrFQAU

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 | shyam.ravinair@gmail.com
Lokesh KumarLokesh Kumar
OK, Shyam 

Here you go with the same link.

http://salesforce.stackexchange.com/questions/128456/lockerservice-throws-error-when-saving-a-document-cookie

http://salesforce.stackexchange.com/questions/154415/locker-service-document-cookie-support

Thanks !