Returns preferred path for storing cookie
 for two step verification.
171158
def persistent_cookie_path
      if ENV["SPACESHIP_COOKIE_PATH"]
        path = File.expand_path(File.join(ENV["SPACESHIP_COOKIE_PATH"], "spaceship", self.user, "cookie"))
      else
        [File.join(self.fastlane_user_dir, "spaceship"), "~/.spaceship", "/var/tmp/spaceship", "#{Dir.tmpdir}/spaceship"].each do |dir|
          dir_parts = File.split(dir)
          if directory_accessible?(File.expand_path(dir_parts.first))
            path = File.expand_path(File.join(dir, self.user, "cookie"))
            break
          end
        end
      end

      return path
    end
88381
@Override
    public String getCookieName() {
        if (allowedProps != null) {
            return (String) allowedProps.get(CFG_COOKIE_NAME);
        }
        return null;
    }
1258583
def lwp_cookie_str(cookie):
    
    h = [(cookie.name, cookie.value),
         ("path", cookie.path),
         ("domain", cookie.domain)]
    if cookie.port is not None: h.append(("port", cookie.port))
    if cookie.path_specified: h.append(("path_spec", None))
    if cookie.port_specified: h.append(("port_spec", None))
    if cookie.domain_initial_dot: h.append(("domain_dot", None))
    if cookie.secure: h.append(("secure", None))
    if cookie.expires: h.append(("expires",
                               time2isoz(float(cookie.expires))))
    if cookie.discard: h.append(("discard", None))
    if cookie.comment: h.append(("comment", cookie.comment))
    if cookie.comment_url: h.append(("commenturl", cookie.comment_url))

    keys = sorted(cookie._rest.keys())
    for k in keys:
        h.append((k, str(cookie._rest[k])))

    h.append(("version", str(cookie.version)))

    return join_header_words([h])
981684
def path(self):
        
        return "/".join([
            part
            for part in [
                self.version,
                self.qualifier,
            ]
            if part
        ])
573914
def ensurepath(path_, verbose=None):
    
    if verbose is None:
        verbose = VERYVERBOSE
    return ensuredir(path_, verbose=verbose)
884749
private Cookie convertCookieString(String cookieString) {
        Cookie cookie = new Cookie(getCookieParam(NAME, cookieString), getCookieParam(VALUE, cookieString));

        if (cookieString.contains(COMMENT)) {
            cookie.setComment(getCookieParam(COMMENT, cookieString));
        }

        if (cookieString.contains(PATH)) {
            cookie.setPath(getCookieParam(PATH, cookieString));
        }

        if (cookieString.contains(DOMAIN)) {
            cookie.setDomain(getCookieParam(DOMAIN, cookieString));
        }

        if (cookieString.contains(MAX_AGE)) {
            cookie.setMaxAge(Integer.valueOf(getCookieParam(MAX_AGE, cookieString)));
        }

        if (cookieString.contains(SECURE)) {
            cookie.setSecure(Boolean.valueOf(getCookieParam(SECURE, cookieString)));
        }

        if (cookieString.contains(VERSION)) {
            cookie.setVersion(Integer.valueOf(getCookieParam(VERSION, cookieString)));
        }

        if (cookieString.contains(HTTP_ONLY)) {
            cookie.setHttpOnly(Boolean.valueOf(getCookieParam(HTTP_ONLY, cookieString)));
        }

        return cookie;
    }
819823
@Sensitive
    private String getStoredReq(HttpServletRequest req, ReferrerURLCookieHandler referrerURLHandler) {
        String storedReq = referrerURLHandler.getReferrerURLFromCookies(req, ReferrerURLCookieHandler.REFERRER_URL_COOKIENAME);
        if (storedReq != null) {
            if (storedReq.equals("/"))
                storedReq = "";
            else if (storedReq.startsWith("/"))
                storedReq = storedReq.substring(1);
        } else {
            storedReq = "";
        }
        return storedReq;
    }
1112029
@Override
	public T visitSchemeAuthorityAndPath(SchemeAuthorityAndPathContext ctx) {
		//on(ctx);
		appendAst(ctx, tok(SCHEME_AUTH_PATH_PART));
		return super.visitSchemeAuthorityAndPath(ctx);
	}
964779
def keep_path(self, path):
        
        if len(path.addr_trace) < 2:
            return True

        return self.should_take_exit(path.addr_trace[-2], path.addr_trace[-1])
1339031
def GetSubkeyByPath(self, key_path):
    
    pyregf_key = self._pyregf_key.get_sub_key_by_path(key_path)
    if not pyregf_key:
      return None

    key_path = key_paths.JoinKeyPath([self._key_path, key_path])
    return REGFWinRegistryKey(pyregf_key, key_path=key_path)
1217222
function getCookieOptions() {
    let cookieOpt = {
      httpOnly: true
    };
    if (opt.cookieDomain) {
      cookieOpt.domain = opt.cookieDomain;
    }
    if (opt.secure) {
      cookieOpt.secure = true;
    }
    if (opt.cookiePath) {
      cookieOpt.path = opt.cookiePath;
    }
    return cookieOpt;
  }
186940
public static function CreateCookieSavePath ($cookie_name, $name = self::DEFAULT_CONNECTION_NAME) {
		return sprintf('%s/%s', rtrim(str_replace("\\", '/', static::GetAuthCookieSessionSavePath($name)), '/') , $cookie_name);
	}
973668
protected function getCookieFileName(): string
    {
        return $this->cookiePath . sha1($this->username . chr(0) . $this->password . chr(0) . $this->userAgent);
    }
1327416
function cookie(name, value, ttl, path, domain, secure) {
    if (arguments.length > 1) {
        let newCookie = name + '=' + encodeURIComponent(value) +
            (ttl ? "; expires=" + new Date(+new Date()+(ttl*1000)).toUTCString() : '') +
            (path   ? "; path=" + path : '') +
            (domain ? "; domain=" + domain : '') +
            (secure ? "; secure" : '');
        document.cookie = newCookie;
        return newCookie;
    }
    return decodeURIComponent((("; "+document.cookie).split("; "+name+"=")[1]||"").split(";")[0]);
}
1266459
def _get_path(entity_id):
    '''
    '''
    try:
        path = entity_id.path()
    except AttributeError:
        path = entity_id
    if path.startswith('cs:'):
        path = path[3:]
    return path
395514
def request_sid_cookie(self, username, password):
        """"""
        log.debug("Requesting SID cookie")
        target_url = self._login_url + '?usr={0}&pwd={1}&persist=y'.format(
            username, password
        )
        cookie = urlopen(target_url).read()
        return cookie
1229231
def _get_cookie(self, name, domain):
        ''' 
        '''
        for c in self.session.cookies:
            if c.name==name and c.domain==domain:
                return c
        return None