?
Solved

Display a session file

Posted on 2003-03-20
4
Medium Priority
?
214 Views
Last Modified: 2009-07-29
In the development of my application, I have created a cool on/off function display for the administrative users of the site to be able to view detailed debug information in an effort to assist in the issue resolution. Having said this, I am wnating a simple way to show all current Session Variables which are set in the current session. These session variables are set when the user logs in and remain in effect till the user logs off.

My attempts have included the following;

 $f = file_get_contents( "/tmp/".session_id() );
 echo $f;

FAILS :
Warning: file_get_contents(/tmp/9a0553cdfcc15ff7f1e4bdf7722b282b) [function.file-get-contents]: failed to create stream: No such file or directory in /HIDDEN_VIEW/public_html/HIDDEN_VIEW/index.php on line 17


and

 <? INCLUDE("/tmp/".session_id());

FAILS :
Warning: main(/tmp/9a0553cdfcc15ff7f1e4bdf7722b282b) [function.main]: failed to create stream: No such file or directory in /HIDDEN_VIEW/public_html/HIDDEN_VIEW/index.php on line 23

Warning: main() [function.main]: Failed opening '/tmp/9a0553cdfcc15ff7f1e4bdf7722b282b' for inclusion (include_path='.:') in /HIDDEN_VIEW/public_html/HIDDEN_VIEW/index.php on line 23


Help... what will correct this. I am the physical server owner in my facility. I mention this in case there is a config parameter that is needing to change.

Thanks in advance for your help...
-greg
0
Comment
Question by:Gregory Miller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 11

Author Comment

by:Gregory Miller
ID: 8175048
additional info from phpinfo();
session
Session Support  enabled  
Registered save handlers  files user  

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_dividend 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid Off Off

0
 
LVL 15

Accepted Solution

by:
VGR earned 500 total points
ID: 8175212
either :
foreach ($_SESSION as $key=>$value) {
  echo "variable '$key' is set to $value'<BR>";
}

or

for ($i=0;$i<count($_SESSION);$i++) echo "variable '".$_SESSION[$i][0]."' is set to ".$_SESSION[$i][1]."'<BR>";
0
 
LVL 11

Author Comment

by:Gregory Miller
ID: 8175290
Worked like a champ...

Thanks,
-greg
0
 
LVL 15

Expert Comment

by:VGR
ID: 8175665
de rien 8-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question