I want to read the cookies out of the DOM document object. I tried the following:
Controller:
init : function(component, event, helper) {
console.log(document.cookie); // returns nothing
}
Renderer:
afterRender : function(component, helper) {
console.log(document.cookie); // returns nothing
}
I want to read the Salesforce session id out of the cookies. I also tried to get the session id via apex:
@AuraEnabled
public static string requestSession() {
return UserInfo.getSessionId();
}
But I can not use the returned id for REST API calls. But the sid in the cookies works for REST API.
Thanks!