PHP server session variables

Zoltan Ganyecz gndl at chello.hu
Tue Feb 21 17:14:15 UTC 2006


2006-02-21, k keltezéssel 12.28-kor Rodolfo Alcazar ezt írta:
> You're right, but the file is a mess. If there is no any other option, I
> must grep/cut/sed the file and get the variables I need.

Try this: create a file named 'read_session_vars.php':

<?php
$id = ereg_replace( '^sess_?','',basename( $_SERVER['argv'][1] ) );
session_id( $id );
session_start();
print_r( $_SESSION );
?>

..then run with php:

$: /usr/bin/php -f read_session_vars.php /where/session/file/is

The first and only argument is the path of the session file.
-- 
Best Regards:
Zoltan Ganyecz <gndl at chello.hu>




More information about the users mailing list