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

Serious help needed for writing cookie in in-line visualforce page of Case Page Layout

Hi All,


I have a pagelayout for case which contains inline visualforce page. In that page I am storing a cookie. When I see cookies in FF I get values as follows:


Path: /

Name: test

Value: testvalue


Now when I try to access this cookie in my controller which is extension of the above page by following command:

Cookie myCookie = ApexPages.currentPage().getCookies().get('test');

and then try to debug value of this cookie by:



I get null, though I am having a value stored in it which is shown in FF.


After doing a thorough analysis, I came up with the conclusion that for setting cookie domain name is required and if the domain value is blank(not specified), its access is defaulted to the site from where it is set.And also I cannot set the cookie with the domain name of Case Page Layout as salesforce has not given permissions to get values of parent page. Also I have hardcoded the value of domain name while setting cooke, the cookie doesnt sets in this case. :(



That's why I am not able to access this cookie from my controller as it takes cookies from currentPage()


Any expertise who has faced this earlier and has a solution to it would help me a lot and also would be Highly Appreciated. There has to be a workaround for this.


If you have a solution/thought/suggestion, please contact me on Skype, Id :lakshman.sfdc or provide here.

Thank you!





Hi All,


Anybody here to Help me, to give suggestions/thoughts?






Hi Lakshman,

Did you get solution for your problem. I'm also facing the same issue. Your input for solution will be highly appreciated!!







We cannot do this due to domain of PageLayout and Visualforce is different. Try creating a child object(Master-Detail) and save value in it. I did achieve by doing like this.




Mike PapperMike Papper

Apex assumes cookies are anmed with a apex__ prefix. Can you try setting the name of your cookie (as created in FF) to apex__test?