Links (A HREF) loosing my session

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



   Hello All, my first time here at list.

   Well, I am with a very weird question, never happened with me,
always worked fine.

   First of all, I am using WAMP (php 5.2.6, apache 2.2.8, mysql
5.0.51b), Firefox (All
cookies allowed), Windows XP SP 3 (I think ;-)... Ah, the
"session.save_path" property is pointing
to a valid path and the session files are been created there. The
"session.cookie_domain" I leave
in blank, as I saw in other forum.

   That code below is not working properly. First time it creates the
session and show me
"First activation etc etc". If I press CTRL-R (Firefox, but I tested
in IE too), it gets the same
session, showing me the next number.

   If I press First Link (Again 1), it creates a NEW SESSION, when It
would get the old one. And now,
every CTRL-R is getting me a new session. Only If I go at address bar
and hit ENTER, I can get
the very first session created.

   The second link (Again 2) is a test. I saw that, if I set:

session.use_only_cookies=0
session.use_trans_sid=1

   this link works fine. But, I don't want to pass Session ID every
link. I tried to set the properties above
in other ways, but I get the same behavior: session lost in every link click.

   Could someone execute this script, to see if it has some wrong?

   Could you please help me...

         Thank you in advance.

                     Razer.

<?php
session_start();
if (!isset($_SESSION['test'])) {
  echo "First activation: setting session variable";
  $_SESSION['test'] = 1;
} else {
  echo "SESSIONS ARE WORKING! activation: ", (++$_SESSION['test']);
?>
<br><a href="http://localhost:8081/testesession.php";>Again 1</a>
<br>
<br><a href="http://localhost:8081/testesession.php?<?php echo
session_name().'='.session_id();?>">Again 2</a>
<?php
}
echo "<br>" . session_id() . "<br><br>";
?>

--
________________________________
Razer Anthom Nizer Rojas Montaño

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux