Re: Links (A HREF) loosing my session

From: Date: Mon, 02 Jun 2008 19:02:41 +0000
Subject: Re: Links (A HREF) loosing my session
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-274936@lists.php.net to get a copy of this message
1. If you're using cookies, there's no need to pass the session name via the URL. 2. Is the cookie being created? ~Ted On 2-Jun-08, at 11:32 AM, Razer Montaño wrote:
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


« previous php.general (#274936) next »