PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > How to display ALL session variables?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
How to display ALL session variables?

Réponse
 
LinkBack Outils de la discussion
Vieux 18/10/2007, 09h35   #1
Ronald Wiplinger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut How to display ALL session variables?

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
  Réponse avec citation
Vieux 18/10/2007, 09h40   #2
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] How to display ALL session variables?

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

  Réponse avec citation
Vieux 18/10/2007, 10h16   #3
truncatei@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] How to display ALL session variables?

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);

  Réponse avec citation
Vieux 18/10/2007, 10h25   #4
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] How to display ALL session variables?

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

  Réponse avec citation
Vieux 18/10/2007, 11h03   #5
Ronald Wiplinger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] How to display ALL session variables?

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
  Réponse avec citation
Vieux 18/10/2007, 11h11   #6
Ronald Wiplinger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] How to display ALL session variables? - solved

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
  Réponse avec citation
Vieux 18/10/2007, 11h18   #7
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] How to display ALL session variables?

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

  Réponse avec citation
Vieux 18/10/2007, 14h14   #8
Ronald Wiplinger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] How to display ALL session variables?

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
  Réponse avec citation
Vieux 18/10/2007, 14h22   #9
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] How to display ALL session variables?

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

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 04h43.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15397 seconds with 17 queries