Throw decoy cookies at session start which are configured exactly as the
session cookie. This doesn't contribute in pure security measures, but
contribute in hiding server footprints and add a little more confusion
to the overall communication.
9394
public function throwDecoys()
    {
        $params = session_get_cookie_params();
        $len = strlen(session_id());
        foreach ($this->decoys as $decoy) {
            $value = Cryptography::randomString($len);
            setcookie(
                $decoy,
                $value,
                $params['lifetime'],
                $params['path'],
                $params['domain'],
                $params['secure'],
                $params['httponly']
            );
            $_COOKIE[$decoy] = $value;
        }
    }
813335
private function initialize()
    {
        $this->name = (isset($this->configurations['name']))
            ? $this->configurations['name']
            : self::DEFAULT_SESSION_NAME;
        $this->assignSessionLifetime();
        if (isset($this->configurations['encryption_enabled'])
            && $this->configurations['encryption_enabled']) {
            $this->handler = new EncryptedSessionHandler();
        }
        $this->security = new SecuritySession($this->configurations);
    }
1368853
def delete_cookie(self, cookie_name=None):
        
        if cookie_name is None:
            cookie_name = self.default_value['name']

        return self.create_cookie("", "", cookie_name=cookie_name, kill=True)
1325280
private void performAdjustCookies(HttpServletRequest request, HttpServletResponse response) throws Exception {

		boolean loggedIn = false;
		User user = null;
		try {
			Cookie cookie = getCookieFromRequest(request);
			if( null != cookie ) {
				user = CookieAuthentication.verifyCookieString(userRepository, cookie.getValue());
				loggedIn = true;
			}
		} catch(Exception e) {
			// Ignore
		}
		
		if( null == user ) {
			user = userRepository.getDefaultUser();
		}
		
		acceptRequest(response, loggedIn, user);
	}
428917
def _on_socket_started(self):
        """"""
        # pylint: disable=W0212
        cookies = self._abode._get_session().cookies.get_dict()
        cookie_string = "; ".join(
            [str(x) + "=" + str(y) for x, y in cookies.items()])

        self._socketio.set_cookie(cookie_string)
1355213
protected function usingCookieSessions()
    {
        if (! $this->sessionConfigured()) {
            return false;
        }

        $session = $this->manager->driver();

        //
        $handler = $session->getHandler();

        return ($handler instanceof CookieSessionHandler);
    }
240381
def set_browser_id
      until cookies[Authie.config.browser_id_cookie_name]
        proposed_browser_id = SecureRandom.uuid
        unless Session.where(:browser_id => proposed_browser_id).exists?
          cookies[Authie.config.browser_id_cookie_name] = {
            :value => proposed_browser_id,
            :expires => 5.years.from_now,
            :httponly => true,
            :secure => @controller.request.ssl?
          }
          # Dispatch an event when the browser ID is set.
          Authie.config.events.dispatch(:set_browser_id, proposed_browser_id)
        end
      end
    end
1332019
def _set_session_cookie(self):
        """"""
        LOGGER.debug('Setting session cookie for %s', self.session.id)
        self.set_secure_cookie(name=self._session_cookie_name,
                               value=self.session.id,
                               expires=self._cookie_expiration)
652973
def _prepare_cookies(self, command, url):
        

        req = requests.models.Request()
        req.method = 'GET'
        req.url = url

        cookie_values = requests.cookies.get_cookie_header(
            self.session.cookies, req)

        if cookie_values:
            self._add_cookies(command, cookie_values)
671507
function() {

            // We perform the bindings so that every function works
            // properly when it is passed as a callback.
            this.get                = utils.bind(this, this.get);
            this.del                = utils.bind(this, this.del);
            this.post               = utils.bind(this, this.post);
            this.request            = utils.bind(this, this.request);
            this._buildResponse     = utils.bind(this, this._buildResponse);

            // Set our default version to "none"
            this._setSplunkVersion("none");

            // Cookie store for cookie based authentication.
            this._cookieStore = {};
        }
52520
def _check_cookie_and_session
      if session[:__reqref]
        tmp = session[:__reqref]
      else
        if cookies.signed[:__reqref]
          tmp = cookies.signed[:__reqref]
          tmp = _increment_returning_count(tmp)
          _set_cookie(__reqref: tmp)
        else
          tmp = "req=#{request.url}|ref=#{request.referrer}|ret=0"
          _set_cookie(__reqref: tmp)
        end
        session[:__reqref] = tmp
      end
    end
101909
def expire_cookies(session = false)
      @domains.delete_if do |_domain, paths|
        paths.delete_if do |_path, cookies|
          cookies.delete_if do |_cookie_name, cookie|
            cookie.expired? || (session && cookie.session?)
          end
          cookies.empty?
        end
        paths.empty?
      end
    end
483044
protected function sendCookies()
    {
        foreach ($this->cookies as $cookie) {
            setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpireTimestamp(), $cookie->getPath(),
                $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
        }
    }
1150650
public function should_start_session() {
		$start_session = true;
		if ( ! empty( $_SERVER['REQUEST_URI'] ) ) {
			$blacklist = $this->get_blacklist();
			$uri       = ltrim( $_SERVER['REQUEST_URI'], '/' );
			$uri       = untrailingslashit( $uri );
			if ( in_array( $uri, $blacklist ) ) {
				$start_session = false;
			}
			if ( false !== strpos( $uri, 'feed=' ) ) {
				$start_session = false;
			}
		}
		if ( isset( $_GET['page'] ) && 'geot-debug-data' == $_GET['page'] ) {
			$start_session = false;
		}

		return apply_filters( 'geot/sessions/start_session', $start_session );
	}
689825
static function destroy(){
		if( ! self::started() ){
			trigger_error( "Session not started", E_USER_WARNING );
			return;
		}
		if( session_id() !== self::$Session->id ){
			trigger_error( "Wrong session id", E_USER_WARNING );
			return;
		}
		// start new session trashing the old one
		if( ! headers_sent( $file, $line ) ){
			session_regenerate_id( true );
			new PLUGSession();
		}
		// unless it's too late to send a new cookie
		else {			
			session_destroy();
			unset( $_SESSION['PLUGSession'] );
		}
	}
1305920
protected function _assertCookieRestriction()
    {
        $stat = false;
        if ( php_sapi_name() !== 'cli' ) {
            if ( headers_sent() )
                throw new \Exception('Headers was sent, cookies must be sent before any output from your script.');

            $stat = true;
        }

        if ( false === $stat )
            throw new \Exception('Session Cant Be Initialized.');
    }
407485
public function destroyDecoys()
    {
        foreach ($this->decoys as $decoy) {
            setcookie($decoy, '', 1);
            setcookie($decoy, false);
            unset($_COOKIE[$decoy]);
        }
    }