Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Sep 2009 at 20:43 UTC
Updated:
13 Dec 2013 at 15:17 UTC
Jump to comment: Most recent
Comments
Comment #1
gpk commentedI imagine the same problem will arise in hook_book() after a cached response.
Related: #201122: Drupal should support disabling anonymous sessions.
Comment #2
gpk commentedWorkaround: prior to storing something in $_SESSION or calling drupal_set_message(), do
Comment #3
c960657 commentedI wonder if this is a duplicate of #592482: Regression: data stored in $_SESSION in hook_boot() or hook_exit() during a cached page response is lost ...
Comment #4
gpk commentedUm, this *is* #592482 ... ;)
Comment #5
c960657 commentedAh, so that's why they are so similar :-)
I meant #758730: Fatal error on logout.
Comment #6
gpk commentedFrom looking at the other issue (without testing anything) I think they may be related but different .. the other one seems specifically concerned with what happens after logout, whereas this is concerned with hook_boot/exit during a cached page response.
Comment #7
Sifro commentedI'm struggling with this error too.
I have a custom module implementing hook_boot:
As you can imagine, the "debug" gets echoed on every single page request, while it should be echoed only on the very first page that the user requests.
It happens both with caching ON and OFF.
If I try to put a var_dump($_SESSION['lock']) at the top of the function, i see a NULL being printed at every request.
@gpk your workaround works fine also with caching enabled, even without including the drupal_bootstrap() call... kind of a mistery. Have you been able to make any progresses on this in the meanwhile?
EDIT: no i was wrong, it doesn't work with caching enabled. THe first time I enter the site it's fine, but if i close the window and re-enter (and caching is enabled) I get a
Fatal error: Call to undefined function drupal_session_start().The drupal_bootstrap() call in hook_boot() gives an error too (regardless of caching setting):
Fatal error: Call to undefined function menu_execute_active_handler()Comment #8
Sifro commentedhttp://drupal.stackexchange.com/questions/88905/custom-php-code-before-a...
Comment #9
gpk commentedI still regard this as an undocumented regression.
@7,
That's why you need the
call since (amongst other things) it does an include on the necessary session.inc file.