login session not behaving

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #16
    a var_dump() output looks different.

    Comment

    • macdalor
      New Member
      • Jan 2010
      • 27

      #17
      this is where I entered the var_dump in the menu.inc:

      Code:
                  	<?php if ($_SESSION['loggedInUser'] == $_SESSION["userCakeUser"]) { ?>Hi <strong><?php echo $_SESSION[$userdetails["Username"]]; var_dump($_SESSION);?>

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #18
        Hey.

        Try creating a new PHP file int he same directory your other PHP files are and do:
        [code=php]
        <?php
        header('content-type: text/plain');
        session_start() ;
        var_dump($_SESS ION);
        ?>
        [/code]
        This tells you whether the session is working, and what is in it.

        Post the output here so we can see what data you are actually working with.

        Comment

        • macdalor
          New Member
          • Jan 2010
          • 27

          #19
          here is the output:

          array(0) {
          }

          I'm no expert but it doesn't look good does it... ;-)

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #20
            that means, that there is an empty session*

            * which also means undefined == undefined (post #17)

            Comment

            • macdalor
              New Member
              • Jan 2010
              • 27

              #21
              ok, is there anything you can suggest for me to get this sorted at all? apologies for my ignorance on the subject...

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #22
                not very much, I fear. I’d look, where and why the assignment didn’t work.

                Comment

                • macdalor
                  New Member
                  • Jan 2010
                  • 27

                  #23
                  for everyone's info, this was sorted by replacing $_SESSION["userCakeUs er"] by "1"

                  Comment

                  Working...