Re: Problem Reading session files
| From: | Tobias Talltorp | Date: | Thu, 12 Apr 2001 23:15:08 +0000 |
| Subject: | Re: Problem Reading session files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48371@lists.php.net to get a copy of this message | ||
Just a comment...
I tried your code and it worked just fine for me, I could see the session
contents.
The only thing that is different in my setup is that I use PHP 4.03pl1...
Try downgrading and see if it works...
// Tobias
""Schulz, Evan"" <evan.schulz@Weigh-Tronix.com> wrote in message
news:919AAA764477D31189A00060942F0B8F142C7F@EXCHANGE...
> I am about to pull my hair out trying to figure out why this isn't
working.
> I figured I would wait and hope that someone else's eyes would pick
> something up, though. I am running it on 4.04pl1 CGI / Win 2k / IIS 5. I
> am trying to read from the session files that are in C:\php\sessiondata in
> order to create an administration script to open up each session file,
grab
> each username variable that I have registered in it, and print the names
to
> the screen.
>
> This is the code I have with comments describing what is happening when I
> run it:
>
> function show_loggedin_users() {
> $loopcounter=0;
> if ($dir = opendir('c:/php/sessiondata')) {
> while($files = readdir($dir)) {
> if (substr($files,0,1) != '.') { file://don't want the '.' or
> '..'
files
> $sess_id[$loopcounter]=substr($files, 5); file://get the sid from
the
> filename (removes the sess_ from the filename)
>
> $fullfilepath='c:/php/sessiondata/'.$files;
>
> $fp = fopen($fullfilepath, "r"); file://open up the session's
file
>
> $fcontents = fread($fp, filesize($fullfilepath)); file://get the
> contents of the file - it won't, though!
> echo $fcontents; file://just to check to see if it worked - it
doesn't
> print anything
> fclose($fp);
> ...
>
> There is a session file in the directory, there are registered variables
in
> the file, and I can print $fullfilepath and get a correct path and
filename
> to the file. I also tried fgets instead of fread. Nothing seems to work,
> though...
>
> Any corrections/thoughts/comments are appreciated.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>