Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Map the cookies in the current document in an array
- // of cookie values, keyed on each's cookie name
- var cookies = [];
- var crumbs = document.cookie.split("; ");
- for (var i = 0; i < crumbs.length; i++) {
- var crumb = crumbs[i];
- var assignmentPos = crumb.indexOf("=");
- var name = crumb.substring(0, assignmentPos);
- var value = crumb.substring(assignmentPos + 1, crumb.length);
- cookies[name] = value;
- }
- // Assume that connection.js is already included
- sforce.connection.sessionId = cookies["sid"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement