public function session(Session $session = null)
    {
        deprecationWarning(
            'ServerRequest::session() is deprecated. ' .
            'Use getSession() instead. The setter part will be removed.'
        );

        if ($session === null) {
            return $this->session;
        }

        return $this->session = $session;
    }
public function session(Session $session = null)
    {
        deprecationWarning(
            'ServerRequest::session() is deprecated. ' .
            'Use getSession() instead. The setter part will be removed.'
        );

        if ($session === null) {
            return $this->session;
        }

        return $this->session = $session;
    }
public function session ( Session $ session = null ) { deprecationWarning ( 'ServerRequest::session() is deprecated. ' . 'Use getSession() instead. The setter part will be removed.' ) ; if ( $ session === null ) { return $ this -> session ; } return $ this -> session = $ session ; }
Returns the instance of the Session object for this request

If a session object is passed as first argument it will be set as
the session to use for this request

@deprecated 3.5.0 Use getSession() instead. The setter part will be removed.
@param \Cake\Http\Session|null $session the session object to use
@return \Cake\Http\Session
Returns the instance of the Session object for this request