You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When custom session handler is used (in my case it's \DB\SQL\Session), \Template::instance()->render call from a page where custom session handler is not initialized destroys the session cookie.
This appears to happen because of this code in base.php for the Preview->render method :
if (isset($_COOKIE[session_name()]) &&
!headers_sent() && session_status()!=PHP_SESSION_ACTIVE)
session_start();
Currently I work around this issue by calling unset($_COOKIE[session_name()]); before rendering, but I'd like to see an option to prevent render method starting the session in the first place.
The text was updated successfully, but these errors were encountered:
The problem is, you cannot access SESSION variables within the template, if the session was not started before. I can understand that starting a needless session is also less optimal, but there's currently no way to automatically know if there's access to a session var within a template or its filters and extentions. So to keep things working as they are right now, starting the session seems mandatory.
Maybe we can adjust this behaviour with a setting and to let the developer decide when to start the session in a newer major version (v4).
When custom session handler is used (in my case it's \DB\SQL\Session), \Template::instance()->render call from a page where custom session handler is not initialized destroys the session cookie.
This appears to happen because of this code in base.php for the Preview->render method :
if (isset($_COOKIE[session_name()]) &&
!headers_sent() && session_status()!=PHP_SESSION_ACTIVE)
session_start();
Currently I work around this issue by calling unset($_COOKIE[session_name()]); before rendering, but I'd like to see an option to prevent render method starting the session in the first place.
The text was updated successfully, but these errors were encountered: