Skip to content

Instantly share code, notes, and snippets.

@alexstrat
Created October 28, 2013 16:50
Show Gist options
  • Save alexstrat/7200426 to your computer and use it in GitHub Desktop.
Save alexstrat/7200426 to your computer and use it in GitHub Desktop.
function(a) {
var f = "linkedin_oauth_" + IN.ENV.auth.api_key;
if (!IN.ENV.auth.is_set_client_auth_cookie || a === "" || a === null) {
window.setTimeout(function d() {
document.cookie = f + "=null;path=/;secure;expires=0";
document.cookie = f + "_crc=null;path=/;expires=0"
}, 0);
return
}
if (typeof a === $_CONSTANTS.types.string) {
try {
a = JSON.parse(a)
} catch (c) {}
}
if ((typeof a) === $_CONSTANTS.types.object) {
a = encodeURIComponent(JSON.stringify(a))
}
window.setTimeout(function b() {
document.cookie = f + "=" + a + ";path=/;secure;";
if (IN.ENV.js.credentialsCookieCrc) {
document.cookie = f + "_crc=" + IN.Util.crc32(a) + ";path=/;"
}
}, 0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment