Re: [phplib] Anyone please assist - active session variables From: toby cabot (toby <email protected>)
Date: 05/23/00

Bryan Willett wrote:
>
> Here is what I want to do:
>
> Retrieve active session variables programmatically
> without creating a session to do so.
>
> How do I do this?

You're probably going to have to make an end-run around the phplib api
and hit the database directly. There's a section in the session docs
about "Reading and understanding session data for debugging" and that's
the place to start. The following code will dump out the sessions
table:

<?php

require( "prepend.php3");

   $db = new DB_whatever;

   $db->query( "
                SELECT sid, name, val, changed
                FROM active_sessions
               ");

   while ( $db->next_record())
   {
      print( "Sid: " . $db->f("sid") . "<br>\n");
      print( "Name: " . $db->f("name") . "<br>\n");
      print( "Init code:<br>\n");
      print( stripslashes( base64_decode($db->f("val"))) . "<p>\n");
   }

?>

Note that what you'll see when you run it is code that initializes the
variables, which may or may not be a format that's useful to you.

Good luck,
Toby

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>