Looking for a $_SESSION clarification...

This is a discussion on Looking for a $_SESSION clarification... within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I've been playing with $_SESSION and I have come across what seems strange to me but hopefully one of ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-29-2005
Shawn Wilson
 
Posts: n/a
Default Looking for a $_SESSION clarification...

I've been playing with $_SESSION and I have come across what seems strange
to me but hopefully one of you understands and can explain it to me.

I put together 4 pages based on info from the manual and the PHPSESSID is
inconsistent in showing up in the address bar while the variables seem to
follow just fine. Am I doing something wrong? (I'd prefer the ID not be
there if that's a choice) But why is it showing up and then going away?

Page one:
--------------------------
<?php
session_start();
$count = 5;
$_SESSION["count"] = $count;
$count2 = 10;
$_SESSION["count2"] = $count2;
?>

<br>
Count is set to: [<?=$count?>].<br>
<br>
To continue, <a href="nextpage.php">click here</a>.<br>
--------------------------

Page 2, 3, and 4 all look like this:
--------------------------
<?php
session_start();
?>

<br>
Count is set to: [<?=$count?>].<br>
Count2 is set to: [<?=$count2?>].<br>
<br>
To continue, <a href="nextpage2.php">click here</a>.<br>
--------------------------

When I click on the link from the first page, the second page shows the ID
in the URL. When I click on the link in the 2nd page and beyond, the ID is
not in the URL anymore. However the variables still follow.

Page one is making the link with the ID in it - which I understand is
automatic because that option is turned on on my server, however why do the
following pages not auto-add the ID as well, and why does it work even
without the ID?

If there is a way to set and access session variables without having the ID
ever
show up in the address bar, I'd prefer that method.

Thanks in advance!

--
Shawn Wilson



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:13 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0