Drupal overrides PHP's session handler and stores all sessions in its own sessions table. Normally, you should never be accessing that table directly since the session info is automatically loaded when it is initialized by a user.
Some time ago though, we needed direct access to the session table and found out this isn't as easy as it seems. The session variables are stored in the session field of the sessions table in a serialized state that isn't decodable with PHP's default unserialize or session_decode functions. Browsing the net, it seemed a lot of people had struggled to decode it and we couldn't find any working solution.
So I decided to give a go at this myself. Here's the solution we found to work in all of our test cases. I can't guarantee it works 100% since I haven't seen documentation on how the serialization is done. If you have more information on this, don't hesitate to comment on this post.