AppserverIo\Appserver\ServletEngine\StandardSessionManager::create PHP Метод

create() публичный Метод

Creates a new session with the passed session ID and session name if given.
public create ( mixed $id, string $name, integer | DateTime $lifetime = null, integer | null $maximumAge = null, string | null $domain = null, string $path = null, boolean $secure = null, boolean $httpOnly = null ) : AppserverIo\Psr\Servlet\ServletSessionInterface
$id mixed The session ID
$name string The session name
$lifetime integer | DateTime Date and time after the session expires
$maximumAge integer | null Number of seconds until the session expires
$domain string | null The host to which the user agent will send this cookie
$path string The path describing the scope of this cookie
$secure boolean If this cookie should only be sent through a "secure" channel by the user agent
$httpOnly boolean If this cookie should only be used through the HTTP protocol
Результат AppserverIo\Psr\Servlet\ServletSessionInterface The requested session
    public function create($id, $name, $lifetime = null, $maximumAge = null, $domain = null, $path = null, $secure = null, $httpOnly = null)
    {
        // copy the default session configuration for lifetime from the settings
        if ($lifetime == null) {
            $lifetime = time() + $this->getSessionSettings()->getSessionCookieLifetime();
        }
        // copy the default session configuration for maximum from the settings
        if ($maximumAge == null) {
            $maximumAge = $this->getSessionSettings()->getSessionMaximumAge();
        }
        // copy the default session configuration for cookie domain from the settings
        if ($domain == null) {
            $domain = $this->getSessionSettings()->getSessionCookieDomain();
        }
        // copy the default session configuration for the cookie path from the settings
        if ($path == null) {
            $path = $this->getSessionSettings()->getSessionCookiePath();
        }
        // copy the default session configuration for the secure flag from the settings
        if ($secure == null) {
            $secure = $this->getSessionSettings()->getSessionCookieSecure();
        }
        // copy the default session configuration for the http only flag from the settings
        if ($httpOnly == null) {
            $httpOnly = $this->getSessionSettings()->getSessionCookieHttpOnly();
        }
        // initialize and return the session instance
        $session = Session::emptyInstance();
        $session->init($id, $name, $lifetime, $maximumAge, $domain, $path, $secure, $httpOnly);
        // attach the session to the manager
        $this->attach($session);
        // return the session
        return $session;
    }