You need to sign in to do that
Don't have an account?

Set cookie on site to get debug logs
I have a force.com site that sometimes has an unhandled execption, it happens. Normally I'd just turn on logging for that guest user and see what the people were doing wrong. After winter '17, users will have to have a special cookie for logs to be created.
My thought was to set this special cookie whenever the user accesses the site. That way I can just turn on logging when needed.
I see the setCookies method, but that adds the apex__ prefix to the name. Is there another way? I'm just an admin code hacker, so forgive me.
My thought was to set this special cookie whenever the user accesses the site. That way I can just turn on logging when needed.
I see the setCookies method, but that adds the apex__ prefix to the name. Is there another way? I'm just an admin code hacker, so forgive me.
I found the following and thought it might be helpful!
https://help.salesforce.com/apex/HTViewSolution?id=000247187&language=en_US
To Set it Manually
First you need to navigate to the Site Url In ur Browser and then Click on Developer tools and then Execute below script through Developer console.
document.cookie ="debug_logs=debug_logs;domain=.force.com";
To Set it through Code
Create an instance of Cookie Class https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_sites_cookie.htm
and then use setCookie Method https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/apex_System_PageReference_setCookies.htm
I welcome feedback.