+ 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 !