If I create a sessionvariabel on one page and ask to echo it on that page if it exists there is no problem.
But if I ask the same on another page, there is no result.

I have set start_session() at the top of the page..

I’m running on win98 (not by choice) with the latest Apache using the latest cgi version of php.

Any ideas…

Please…anyone…

Joe

    Ok firstly session_start(); must be the first thing on every page or it won't work. Apparently even a blank line can throw this out so be warned.

    Secondly u need session_register("myvar"); as well. If the session variable isn't registered on that page you'll have no access to it. This is probably where your problem lies.

    Hope this helps

    Mitchell

      You need to register the session variable on each page that you intend to use the session variable on. If you register the session variable with

      session_register ("variablename");

      your echo call should work.

        Thanks....it was the part about registrating the variable on the page that buged me...
        This is kinda strange to me as i just reused some old code that used to run on at IIS server. In the old code i didn't had to register my variables on all the pages. If they where registret once on the page where they were created that was enough.

        Could it be because i use a newer version of php, or because i use the cgi version now instead of the dll version that was distribuated with the older version?

        But anyway thnks again
        Joe

          ok now if I check if the sessionvariabel is regitred it teels me that it is...This is ok, but if i try to echo the contens of the variable there is no output. the variabl is simply empty. i do like this:

          --page one--
          session_start();
          $variabel = "hello";
          session_register("variable");

          --page two--
          session_start();
          session_register("variable");
          echo $variabel;

          now to my best knowlege this should print "hello" to the screen, but nothing happens..

          Any ideas?

            Hiya Joe,

            Did u cut and paste this code? If u did u got a spelling mistake on page one and page two where u name ur variable "variabEL". This is probably why you're not getting anything out! Go thru and check the spelling of all your variable names!

            As an aside, why not use an editor like PHPEd to write your PHP code. Its free, it has syntax highlighting for HTML, PHP, SQL, etc and it will auto-complete your variable names and functions for you - can save a lot of spelling mistakes!!!

            If this isan't the problem try going to
            http://www.php.net/manual/en/ref.session.php
            and go thru the instructions on that page and check that things like track_vars are on.

            Hope this fixes your problems

            Mitchell

              According to the manual, track_vars is always on.

              I have checked the spelling and the syntax....it should be ok!

              I can't help getting the feeling that it is something about win98. This argument based on the fact that the same code works fine on a win200/IIS and a linux Mandrake/apache installation...

              But why and what......im frustrated

              Im am using php coder pro, but ill check out the other tool you recomended.

              Still if you have any ideas fill free to drop a word..

                a year later

                Check out these lines in php.ini.

                They could be incorrect!

                [Session]
                ; Handler used to store/retrieve data.
                session.save_handler = files

                ; Argument passed to save_handler. In the case of files, this is the path
                ; where data files are stored. Note: Windows users have to change this
                ; variable in order to use PHP's session functions.
                session.save_path = c:/temp

                  Write a Reply...