Answer the question
In order to leave comments, you need to log in
How to work with setcookie in Twig?
Guys, started working with Twig. There was a problem with cookies and session (Warning: Cannot modify header information - headers already sent by).
There was no such thing before (CMS / engine is mine, self-written), I switch to Twig.
Having figured it out, I realized that setcookie was fooling my head. Question: How to work with setcookie in Twig ?
Close bracket error:
setcookie(
"gkl",
$VisitUser,
time()+2*24*60*60,
"/"
);
echo $twig->render('index.html', array('title' => $title,
'description' => $description,
'keywords' => $keywords,
));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question