$optinService =
$this->container->
get(\Shopware\Components\OptinServiceInterface::
class);
$data =
$optinService->
get(OptinServiceInterface::TYPE_THEME_PREVIEW,
$hash);
if (!
$data) { return false;
} $optinService->
delete(OptinServiceInterface::TYPE_THEME_PREVIEW,
$hash);
$this->
Response()->headers->
setCookie( new Cookie( $data['sessionName'
],
$data['sessionValue'
],
0,
$this->
Request()->
getBaseUrl(),
null,
$this->
Request()->
isSecure() ) );
// Disable http cache for this Request
$this->
Response()->headers->
set('cache-control', 'private'
);