Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Jan 2012 at 09:58 UTC
Updated:
5 Mar 2012 at 12:20 UTC
This notice appears when logging in via HTTPS. The fix for this issue is part of #1050746: HTTPS sessions not working in all cases which has unfortunately stalled.
Also related: #744384: Do not write unchanged sessions to the database.
Here is a patch for Drupal 7 that fixes the notice until #1050746: HTTPS sessions not working in all cases is committed. Useful for sites that are not interested in HTTP/HTTPS mixed mode, but still encounter this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| write-session-notice.patch | 725 bytes | klausi |
Comments
Comment #1
seanburlington commentedIt looks to me like this patch just suppresses the warning
But the $user->timestamp value is not set and as well as any other issues this degrades performance - by failing to restrict saves to the session table as the comment indicates should happen
I think that applying the patch individually to avoid clogging logs may be OK but I wouldn't want this patch in core - the underlying problem needs to be resolved.
Comment #2
james.williamsWhen should
$user->timestampbe set? It looks to come from the$_SESSIONrather than the original account object but I don't fully understand how that gets merged into the user object.To be honest, whether there is an underlying issue or not, I think it is correct to add a check for
$user->timestamp, since if this function is abstracted away from the rest of core, it shouldn't matter if the timestamp is not set - the session should always get updated if this is the case whatever the reason, and a PHP notice is unnecessary.Wherever the underlying cause is though, that probably does also need identifying and a perhaps a more descriptive notice/warning thrown up there.
For reference, this issue is also being covered here: #1078614: Notice: Undefined property: stdClass::$timestamp in _drupal_session_write(). One of these issues should be marked as a duplicate.
Comment #3
james.williamsMarking this issue as duplicate -- I've referenced this discussion over at #1078614: Notice: Undefined property: stdClass::$timestamp in _drupal_session_write().
@seanburlington Please weigh in over at that other issue to help progress this issue if you want to.