Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sessions and IE

Status
Not open for further replies.

aarrgghh

Technical User
Sep 5, 2002
60
US
Hey all,

My understanding of sessions is that when variables are set, they are not available until the user goes to the next page or refreshes his or her browser.

I find that when I send a user to another page via a text based link (i.e., <A HREF=&quot;link...&quot;>link text</a>) that the session variable are not available until I refresh the page again. This is not the case for netscape.

However, when I send the user to the next page via a html form using a submit button the variables are available when the browser renders the next page...as they should be. So what is with the text based link that wont allow IE to see the variables until it has been refreshed again?

Thanks in advance.
 
It could be a cache problem. IE's caching mechanism is pretty primitive. It handles ASP-derived content well, sometimes but has problems knowing when to refresh output of other scripting languages.

I can tell you that this code:
[test_setsession1.php]
Code:
<?php
session_start();
$_SESSION['a'] = 'exists';
print '<html><body>set<br><a href=test_setsession2.php>here</a></body></html>';
?>

[test_setsession2.php]
Code:
<?php
session_start();
print $_SESSION['a'];
?>


Outputs the word &quot;exists&quot; when I click the link. Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top