Problem/Motivation

Getting unserialize warning whenever loading to user session screen

Steps to reproduce

Go to the user session page user/[uid]/sessions. You will see notice displays on the top.
Warning: unserialize(): Extra data starting at offset 183 of 318 bytes in Drupal\session_inspector\SessionUnserializer::unserializePhp() (line 66 of modules/contrib/session_inspector/src/SessionUnserializer.php).

CommentFileSizeAuthor
Screenshot 2024-04-19 at 17.53.32.png81.96 KBmanish.jain

Comments

manish.jain created an issue. See original summary.

manish.jain’s picture

Issue summary: View changes
manish.jain’s picture

Assigned: manish.jain » Unassigned
philipnorton42’s picture

Assigned: Unassigned » philipnorton42
philipnorton42’s picture

Thanks for the bug report!

It looks like the "php" session.serialize_handler doesn't work correctly. It is needed to read the data held in other sessions and pick out data like the user agent and masqurade settings.

Looking at the strings in the session data is doesn't look like using string positions is the best way to go about things. I think a better way is to use the session_decode() method since that is built into PHP and should be able to read the session data correctly. I needed to get around the fact that this method alters the current session and use a temporary session to grab hold of the data.

Change incoming :)

  • philipnorton42 committed 606cdde6 on 1.0.x
    Issue #3442086 by manish.jain, philipnorton42: Warning: unserialize():...
philipnorton42’s picture

Status: Active » Fixed

Change committed and released as 1.0.5 (https://www.drupal.org/project/session_inspector/releases/1.0.5)

Thanks!

philipnorton42’s picture

Status: Fixed » Closed (fixed)