PageSourceSearch

https://myprofile.servsafe.com/assets/servsafe/scripts/cookieHandling.js

js servsafe.com collected 2026-10-01 10:13:27 UTC 2,617 bytes, 78 lines download raw bytes

1//cookie variable names
2//this is as is
3var pingLanguageCookie = "pf-accept-language";
4//these need environment put in front of them
5var portalNameCookie = "PortalName";
6var languageCookie = "SiteLang";
7var sraCookie = "SRAState";
8
9var esnCookie = "ESNToken";
10var PersonIdCookieName = "PersonId";
11var SessionIdCookieName = "SessionId";
12var SiteLangCookieName = "SiteLang";
13var AnswerSheetIdCookieName = "AnswerSheetId";
14
15
16var legacyErrorCookie = "LegacyErrorLogin";
17//this cookie will be concatenated with the Ping Resume ID for a unique session variable
18var siteCookie = "-site";
19
20function envCookieName(cookieName) {
21    //cookieEnvPrefix needs to be defined in the html template (from configuration.html)
22    return cookieEnvPrefix + cookieName;
23}
24
25function sessionSiteCookieName(sessionName) {
26    //calling function can get sessionName from form Action link!
27    return sessionName + siteCookie;
28}
29
30function parseActionForSession(link) {
31    //link format: [domain]/idp/L4JMR/resumeSAML20/idp/startSSO.ping
32    var secondslash = link.indexOf("p/", 1);
33    var thirdslash = link.indexOf("/", secondslash + 2);
34    var session = link.substring(secondslash + 2, thirdslash);
35    return session;
36}
37
38function setCookie(cname, cvalue, exdays) {
39    var d = new Date();
40    d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
41    var expires = "expires=" + d.toUTCString();
42    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
43}
44function setCookieForMinutes(cname, cvalue, exMinutes) {
45    var d = new Date();
46    d.setTime(d.getTime() + (exMinutes * 60 * 1000));
47    var expires = "expires=" + d.toUTCString();
48    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
49}
50
51if (window.cookieService == null) {
52    window.cookieService = (function () {
53        var cookies = {};
54        document.cookie.split(';').forEach(function (cookie) {
55            var eqIndex = cookie.indexOf('=');
56            if (eqIndex !== -1) {
57                cookies[cookie.substring(0, eqIndex).trim()] = cookie.substring(eqIndex + 1);
58            }
59        });
60        return {
61            getCookie: function (cname) {
62                return cookies[cname] || "";
63            }
64        };
65    })();
66}
67
68function getCookie(cname) {
69    return window.cookieService.getCookie(cname);
70}
71
72function eraseCookie(key, domain) {
73    var path = "/";
74     document.cookie = key + "=" +
75         ((path) ? ";path=" + path : "") +
76         ((domain) ? ";domain=" + domain : "") +
77         ";expires=Thu, 01 Jan 1970 00:00:01 GMT";
78}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.