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
NikeNike 

How to get Cookie from iframe

How to get the cookies of the iframe inside my vf page. as now am getting the salsforce session/client etc.

 

vf Code:

 

<apex:form >
<apex:iframe src="my third party url">
 <script type="text/javascript" id="refreshArea">
var getCookies = function(){
  var pairs = document.cookie.split(";");
  alert(pairs);
  var cookies = {};
  for (var i=0; i<pairs.length; i++){
    var pair = pairs[i].split("=");
    cookies[pair[0]] = unescape(pair[1]);
  }
  return cookies;
}
var myCookies = getCookies();
</script>
<apex:actionFunction name="refreshArea" oncomplete="getCookies();"/>
</apex:iframe>
</apex:form>