473,800 Members | 2,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php4+apache1.3+ xp with sessions not working...

Please help.

I seem to have a major problem with sessions on my setup. No simple
example seems to work. Example below:

page1.php:

<?php
// page1.php

session_start() ;

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['time'] = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php ">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php ?' . SID . '">page 2</a>';
?>

Page2.php:

<?php
// page2.php

session_start() ;

echo 'Welcome to page #2<br />';

echo $_SESSION['favcolor']; // green
echo $_SESSION['animal']; // cat
echo date('Y m d H:i:s', $_SESSION['time']);

// You may want to use SID here, like we did in page1.php
echo '<br /><a href="page1.php ">page 1</a>';
?>

Output after pressing page2 link:

Welcome to page #2
1970 01 01 00:00:00
page 1

As you may be able to see, page 1 sets the date but page 2 thinks the
variable is not set and the 2 other bits, green and cat are also not
displayed. I have been told that this should work fine. Please tell me
what to look for in my setup?

Thanks
Dan
Jul 17 '05 #1
1 2845
da**********@ta lk21.com (Dan Walker) schrieb:
I seem to have a major problem with sessions on my setup. No simple
example seems to work.


According to your subject I assume you're using Windows. Did you alter
the php.ini to set a coorect path for the seesion data?

This should be something like:

session.save_pa th = E:/temp

Regards,
Matthias
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
7205
by: Chewy509 | last post by:
Hi Everyone, I'll just start, and say I am not a PHP developer (I'm a sysadmin, who has gotten lumped with a non-working website). But since I like to do this type of stuff, I though I might just learn WTF is going on? :) Basically, sessions are being created, but no info in being stored in the session, and if data is stored (about 1 in 20 goes), it doesn't follow-on on a page redirect.
1
1791
by: Mountain Man | last post by:
Hi, I posted on this matter earlier with the subject line "Trouble with sessions," but someone else started a different thread with the same subject line that arrived before my post, so I'm changing my subject line in order to avoid confusion. I was asked to provide a code example for analysis, so here it is, along with a a description of what the problem is.
1
1973
by: porneL | last post by:
I've had setup on WinXP: Apache1.3 with PHP4 module and PHP5 installedas CGI for one vhost. This worked fine, till I installed Zend Studio 4 beta. I'm trying to make Zend Server use my existing configuration, but without success. If I point it to PHP4 php.ini, PHP cannot find (or rather refuses to load) modules. If I point it to PHP5 php.ini, I cannot enter server console, because my php lacks ZendOptimizer
2
1531
by: Vic Spainhower | last post by:
Hello, I am attempting to get PHP4 working with IIS but the php script is ignored. I installed Apache and it works with the Apache server so it is obviously a configuration error on my part but I can't find it. I have a test.php file that I run with each configuration. TIA Vic
0
2038
by: bissatch | last post by:
Hi, I have installed Apache2. I have installed PHP4.3.0. All is working fine. I have now went and tried to install DOMXML into PHP by simply uncommenting the extension = php_domxml.dll (or something like that) in php.ini. Unfortuntely I get the following error at a part of my PHP page where I try to load a xml file:
2
419
by: Erik | last post by:
Hi All, I'm writing an web application with PHP/MySQL. I used PHP5 but believed to use code that would work also under PHP4. However when I tried my application under PHP4 I got the warning that the headers are already sent and my session did not work. I do understand that I have to send the headers before anything else. But does anyone know what kind of difference between PHP4 and PHP5 makes it possible for sessions to work under PHP5...
4
3683
by: ctclibby | last post by:
Hi All Seem to be getting zombie sessions. /tmp/sess_ exist and are owned by daemon. I am guessing and these could come from brower crashes, networks gone down ... etc ... even from stuff that I haven't done properly. So for the big question. Can I run a cron job and delete these? Or does PHP also store stuff in another location and could cause me grief down the road? Thanks in advance!
35
2037
by: Steve JORDI | last post by:
Hi, I'm trying to implement a singleton in PHP4 but it doesn't seem to work. The object is recreated each time I call it. The goal of the class is to keep a variable up to date. It's used to display a database content, 25 rows at a time. The singleton keeps track of the current starting row and increases it or decreases it by 25 depending on the user action (pressing a Next or Prev button). Those buttons are submit buttons calling the...
2
2019
abdoelmasry
by: abdoelmasry | last post by:
Hi all i have problem while using sessions i was working with php4 on apache with This Functions: session_start(); session_register("username"); $username="abdoelmasry"; it was working good
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.