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
College ManagementCollege Management 

Any way to setDomain for Cookie in salesforce ?

Is there any possibility to change or set domain for cookies in browsers ?

User-added image

Help me out

Thanks !
Santosh Sriram 2310Santosh Sriram 2310
Hi 

You can set cookies via salesforce class using the Cookie class and its constructor.
Check the link below:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_sites_cookie.htm

_ Santosh 
Jack ZarynskyJack Zarynsky
OP, how you sorted first field?
College ManagementCollege Management
@Santosh,

In provided ref there is nothing to set domain ,
Constructor : Cookie(name, value, path, maxAge, isSecure)
We can provide name, value, path , age and security but there is no way setting domain. No idea how the cookie has been setting its domain in browser.

@Jack, 

First field in the sense ?


Thanks !