Languages :: PHP :: Display a session file |
|||
| By: FiatLink |
Date: 20/03/2003 00:00:00 |
Points: 125 | Status: Answered Quality : Excellent |
|
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... |
|||
| By: FiatLink | Date: 20/03/2003 03:47:00 | Type : Comment |
|
| 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 |
|||
| By: VGR | Date: 20/03/2003 04:10:00 | Type : Answer |
|
| either : foreach ($_SESSION as $key=>$value) { echo "variable '$key' is set to $value' "; } or for ($i=0;$i<count($_SESSION);$i++) echo "variable '".$_SESSION[$i][0]."' is set to ".$_SESSION[$i][1]."' "; |
|||
| By: FiatLink | Date: 20/03/2003 04:18:00 | Type : Comment |
|
| Worked like a champ... Thanks, |
|||
| By: VGR | Date: 20/03/2003 05:07:00 | Type : Comment |
|
| de rien 8-) |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








