Skip to content

Commit

Permalink
NTR: delete unusued code (#397)
Browse files Browse the repository at this point in the history
Co-authored-by: Vitalij Mik <[email protected]>
  • Loading branch information
BlackScorp and Vitalij Mik committed Jan 24, 2024
1 parent 4692397 commit 66422a9
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions Components/SessionManager/SessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,34 +77,6 @@ public function extendSessionLifespan($days)
# it causes the finish-page to have missing data, like missing address.
# it does not make any sense, but its a deep logic of shopware or the session handling
# and we have to remove it for now and stick with the default server and system configuration.
return;

$session = $this->container->get('session');

# write session data and commit database transaction to avoid locks
# @see Shopware\Components\Session\PdoSessionHandler::close()
if (method_exists($session, 'save')) {
$session->save();
}

session_write_close();


$sessionId = $this->getSessionId();
$lifetimeSeconds = $days * 24 * 60 * 60;

ini_set('session.gc_maxlifetime', $lifetimeSeconds);

/** @var QueryBuilder $qb */
$qb = $this->connection->createQueryBuilder();

$qb->update('s_core_sessions')
->set('expiry', ':expiry')
->where($qb->expr()->eq('id', ':id'))
->setParameter(':expiry', time() + $lifetimeSeconds)
->setParameter(':id', $sessionId);

$qb->execute();
}

/**
Expand Down

0 comments on commit 66422a9

Please sign in to comment.