|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Is there a simple way to display all session variables? Like the code
below I use in debug for all posted variables: echo "<h3>posted variables</h3>"; while (list($name, $value) = each($HTTP_POST_VARS)) { echo "$name = $value<br>\n"; } bye Ronald |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 10/18/07, Ronald Wiplinger <ronald@elmit.com> wrote:
> > Is there a simple way to display all session variables? Like the code > below I use in debug for all posted variables: > > echo "<h3>posted variables</h3>"; > while (list($name, $value) = each($HTTP_POST_VARS)) { > echo "$name = $value<br>\n"; > } > echo '<pre>'; var_dump($_SESSION); echo '</pre>'; -nathan |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
2007/10/18, Nathan Nobbe <quickshiftin@gmail.com>:
> > On 10/18/07, Ronald Wiplinger <ronald@elmit.com> wrote: > > > > Is there a simple way to display all session variables? Like the code > > below I use in debug for all posted variables: > > > > echo "<h3>posted variables</h3>"; > > while (list($name, $value) = each($HTTP_POST_VARS)) { > > echo "$name = $value<br>\n"; > > } > > > > echo '<pre>'; > var_dump($_SESSION); > echo '</pre>'; > > -nathan or use print_r($_SESSION); |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
this is a nice little tool as well;
it would be pretty decent for spitting out the session; http://dbug.ospinto.com/ new dBug($_SESSION); -nathan |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
truncatei@gmail.com wrote:
> > > 2007/10/18, Nathan Nobbe <quickshiftin@gmail.com > <mailto:quickshiftin@gmail.com>>: > > On 10/18/07, Ronald Wiplinger <ronald@elmit.com > <mailto:ronald@elmit.com>> wrote: > > > > Is there a simple way to display all session variables? Like the > code > > below I use in debug for all posted variables: > > > > echo '<pre>'; > var_dump($_SESSION); > echo '</pre>'; > > -nathan > > > or use print_r($_SESSION); > > I tried: <?php echo '<pre>'; var_dump($_SESSION); echo '</pre>'; echo '<p>above as var_dump(D_SESSION) - below as print_r(D_SESSION)'; print_r($_SESSION); .... However, I only see: above as var_dump(D_SESSION) - below as print_r(D_SESSION) What is the obviously part I am missing? bye Ronald |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
Ronald Wiplinger wrote:
> truncatei@gmail.com wrote: >> >> >> 2007/10/18, Nathan Nobbe <quickshiftin@gmail.com >> <mailto:quickshiftin@gmail.com>>: >> >> On 10/18/07, Ronald Wiplinger <ronald@elmit.com >> <mailto:ronald@elmit.com>> wrote: >> > >> > Is there a simple way to display all session variables? Like the >> code >> > below I use in debug for all posted variables: >> > >> >> echo '<pre>'; >> var_dump($_SESSION); >> echo '</pre>'; >> >> -nathan >> >> >> or use print_r($_SESSION); >> >> > > I tried: > <?php > echo '<pre>'; > var_dump($_SESSION); > echo '</pre>'; > echo '<p>above as var_dump(D_SESSION) - below as print_r(D_SESSION)'; > print_r($_SESSION); > > ... > > However, I only see: > > above as var_dump(D_SESSION) - below as print_r(D_SESSION) > > What is the obviously part I am missing? Found it: The session was at that moment not open! bye Ronald |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On 10/18/07, Ronald Wiplinger <ronald@elmit.com> wrote:
> > truncatei@gmail.com wrote: > > > > > > 2007/10/18, Nathan Nobbe <quickshiftin@gmail.com > > <mailto:quickshiftin@gmail.com>>: > > > > On 10/18/07, Ronald Wiplinger <ronald@elmit.com > > <mailto:ronald@elmit.com>> wrote: > > > > > > Is there a simple way to display all session variables? Like the > > code > > > below I use in debug for all posted variables: > > > > > > > echo '<pre>'; > > var_dump($_SESSION); > > echo '</pre>'; > > > > -nathan > > > > > > or use print_r($_SESSION); > > > > > > I tried: > <?php > echo '<pre>'; > var_dump($_SESSION); > echo '</pre>'; > echo '<p>above as var_dump(D_SESSION) - below as print_r(D_SESSION)'; > print_r($_SESSION); > > ... > > However, I only see: > > above as var_dump(D_SESSION) - below as print_r(D_SESSION) > > What is the obviously part I am missing? > unless you have session_auto_start set to 1 in php.ini make sure to call session_start() at the top of your script you want to view the session from. -nathan |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
Nathan Nobbe wrote:
> this is a nice little tool as well; > it would be pretty decent for spitting out the session; > > http://dbug.ospinto.com/ > > new dBug($_SESSION); > > -nathan > That is really cool! I like that one! bye Ronald |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
On 10/18/07, Ronald Wiplinger <ronald@elmit.com> wrote:
> > Nathan Nobbe wrote: > > this is a nice little tool as well; > > it would be pretty decent for spitting out the session; > > > > http://dbug.ospinto.com/ > > > > new dBug($_SESSION); > > > > -nathan > > > just watch out for resource types in php5; it still has a bug of its own. i offered to patch it for the author and he was bitter; so just fyi ![]() -nathan |
|
![]() |
| Outils de la discussion | |
|
|