To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Upgrading PHP

Upgrading PHP Issues concerning PHP version upgrades and future releases

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-17-2004, 11:55 AM   #1
ywickham
Senior Member
 
ywickham's Avatar
 
Join Date: Jan 2002
Location: Atlanta, GA
Posts: 126
Sessions and static pages

I have a page (page1.html) that calls an include file (GLOBALS.HTM) that calls my sessions file (sessions.php), all through a server side include. (It's a little convoluted, but I have to work with the current site setup for this client.):

This is the portion of page1.html that calls GLOBALS.HTM -
PHP Code:
<!--#include virtual="/IN/GLOBALS.HTM" -->
<html>
.
.
.
This is the portion of GLOBALS.HTM that calls sessions.php -
PHP Code:
<!--#include virtual="sessions.php" -->
.
.
.
This is sessions.php -
PHP Code:
<?php
session_start
();

if(isset(
$_SESSION['test'])) {

    
// Its registered so display it
    
echo $_SESSION['test'];
    echo
"<br />The above text should say hello";

} else {

    echo
"The session was not set, but now is";
    
$_SESSION['test'] = "Hello World!";
}
?>
When I call sessions.php directly in the browser, it works as expected. When I call page1.html in the browser, sessions.php does not behave the way I expected it to (which is the way it behaves when I call it directly.) Instead, it acts as if the session was not set on every refresh.

I thought that if the session cookie was set, it would automatically be passed to the next page or to the same page in the headers when the page refreshed. Why is that not happening? Is it because page1.html is static? What am I not understanding?

Thanks!

P.S. Our web server is setup to parse these SSIs already and is doing so successfully.

Last edited by ywickham; 08-17-2004 at 12:35 PM.
ywickham is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 01:59 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.