Page 3 of 3
Posted: Fri Oct 06, 2006 3:41 pm
by volka
In IE I don't see anything
That's because I'm still unable to put a valid </title> in the code, grmpf.
Code: Select all
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
session_start();
?>
<html>
<head>
<title>session test</title>
</head>
<body>
<p><?php echo 'time: ', date('H:i:s'); ?></p>
<p><?php echo 'id:', session_id(); ?></p>
<p><?php echo 'name:', session_name(); ?></p>
<p><?php echo 'use_cookie: ', ini_get('session.use_cookies'); ?></p>
<p><?php echo 'use_only_cookie: ', ini_get('session.use_only_cookies'); ?></p>
<p><?php echo 'session.use_trans_sid: ', ini_get('session.use_trans_sid'); ?></p>
<pre><?php print_r($_COOKIE); ?></p>
<div><a href="<?php echo $_SERVER['PHP_SELF']; ?>">reload</a></div>
</body>
</html>
Array
(
)
There should have been a cookie PHPSESSID, but there isn't. The browser does not send any cookies back to the webserver. Therefore php does not know anything about a previously started php session
Posted: Fri Oct 06, 2006 3:53 pm
by Stephen Bungert
But I can save and make cookies with PHP. I've used them before.
And my browser accepts cookies too.
Should I re-install PHP and Apache?
Posted: Fri Oct 06, 2006 3:54 pm
by volka
What does the "latest" version of the script -including error_reporting, ini_set- print?
Again reload the script several times using the link.
Posted: Fri Oct 06, 2006 3:58 pm
by Stephen Bungert
In IE I see the following:
time: 22:57:59
id:2tu7e6hctbkos9ur43dmiu07k6
name:PHPSESSID
use_cookie: 1
use_only_cookie: 0
session.use_trans_sid: 0
Array
(
)
reload
Firefox displays the same too.
The only thing that seems to change is the session id
Posted: Fri Oct 06, 2006 4:01 pm
by volka
hm, still no cookie.
Let's try to set one manually.
Code: Select all
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
// this should appear in _COOKIE after a reload
setcookie('mycookie', date('H:i:s'));
session_start();
?>
<html>
<head>
<title>session test</title>
</head>
<body>
<p><?php echo 'time: ', date('H:i:s'); ?></p>
<p><?php echo 'id:', session_id(); ?></p>
<p><?php echo 'name:', session_name(); ?></p>
<p><?php echo 'use_cookie: ', ini_get('session.use_cookies'); ?></p>
<p><?php echo 'use_only_cookie: ', ini_get('session.use_only_cookies'); ?></p>
<p><?php echo 'session.use_trans_sid: ', ini_get('session.use_trans_sid'); ?></p>
<pre><?php print_r($_COOKIE); ?></p>
<div><a href="<?php echo $_SERVER['PHP_SELF']; ?>">reload</a></div>
</body>
</html>
Posted: Fri Oct 06, 2006 4:05 pm
by Stephen Bungert
time: 23:04:58
id:ak2s2n5sgg03gb5ufr4q462351
name:PHPSESSID
use_cookie: 1
use_only_cookie: 0
session.use_trans_sid: 0
Array
(
[mycookie] => 23:04:58
)
reload
Again only session id changes (and the time and cookie time)
Posted: Fri Oct 06, 2006 4:06 pm
by volka
I suggest deinstalling apache,php,mysql,whatever and using
http://www.apachefriends.org/en/xampp.html
Posted: Fri Oct 06, 2006 4:11 pm
by Stephen Bungert
OK, thanks all for your help... pain in the arse to reinstall but I guess I must.
Thanks all again. I shall post back if re-installing helped.
Posted: Fri Oct 06, 2006 4:12 pm
by volka
installing xampp only takes a minute.
Posted: Sat Oct 07, 2006 2:27 am
by Stephen Bungert
I have it installed now xampp, but I can't find the apache config file there is none. I need to have it set up the way it was before (I still have the old config file. Where the old config file used to be (in the apache directory under xampp) there is only the default config file example. Where's the actuall config file being used by apache?
Posted: Sat Oct 07, 2006 4:29 am
by Stephen Bungert
Found it.
Also sessions now working with xampp installed
Thanks all for your help

Posted: Sat Oct 07, 2006 10:39 am
by RobertGonzalez
Glad you got it working.