On Fri, May 21, 2004 at 08:41:00PM +0000, Curt Zirzow wrote:
> * Thus wrote Michael R. Wayne ([EMAIL PROTECTED]):
> >
> > I've posted several times mentioning that I am completely unable
> > to cause sessions to persist. Over the intervening time, I have
> > replicated this problem to a different machine, with the same
> > results. Here's a recap of the problem.
> >
> > I am not using cookies. Sessions are automatically created (and
> > changing that makes no difference) The relevant session variables
> > (copied from phpinfo) are:
> > Session Support enabled
> > session.auto_start On <- hence no session_start
> > session.name PHPSESSID
> > session.use_cookies Off <- no cookies
> > session.use_trans_sid On
>
> url_rewriter.tags?
url_rewriter.tags a=href,area=href,frame=src,input=src,form=fakeentry
session.use_trans_sid Off
> It seems php isn't picking up that session that is in $_REQUEST..
> which part of request is that variable in? do this?
>
> print_r($_GET);
> print_r($_POST);
> print_r($_COOKIE);
Done - see below
> Also, is the PHPSESSID being written in the form output somewhere?
> View source of form output.
Done all 3 times
=== initial load =====
Stage:0 SessionID: 86cc1b0a4dee900f85981e93bcc855b2
Stage:1 SessionID: 86cc1b0a4dee900f85981e93bcc855b2 Request: Array ( )
GET: Array ( ) POST: Array ( [field] => ) COOKIE: Array ( )
<html>
<head><title>PHP Test page</title></head>
<body>
Stage:0 SessionID: 86cc1b0a4dee900f85981e93bcc855b2 <form method="post"
action="xxx.php?PHPSESSID=86cc1b0a4dee900f85981e93bcc855b2">
<input type="text" maxlength="7" size="7" name="field" value="">
<input type="submit" value="Submit">
</form>
Stage:1 SessionID: 86cc1b0a4dee900f85981e93bcc855b2 Request: Array
(
)
<br>GET: Array
(
)
POST: Array
(
[field] =>
)
COOKIE: Array
(
)
</body> </html>
===== type foo, hit submit. Note differing sesison IDs =====
Stage:0 SessionID: 7c6cd5d1f965de3f134442600f60565a
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a Request: Array ( [PHPSESSID] =>
86cc1b0a4dee900f85981e93bcc855b2 [field] => foo )
GET: Array ( [PHPSESSID] => 86cc1b0a4dee900f85981e93bcc855b2 ) POST: Array ( [field]
=> foo ) COOKIE: Array ( )
<html>
<head><title>PHP Test page</title></head>
<body>
Stage:0 SessionID: 7c6cd5d1f965de3f134442600f60565a <form method="post"
action="xxx.php?PHPSESSID=7c6cd5d1f965de3f134442600f60565a">
<input type="text" maxlength="7" size="7" name="field" value="foo">
<input type="submit" value="Submit">
</form>
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a Request: Array
(
[PHPSESSID] => 86cc1b0a4dee900f85981e93bcc855b2
[field] => foo
)
<br>GET: Array
(
[PHPSESSID] => 86cc1b0a4dee900f85981e93bcc855b2
)
POST: Array
(
[field] => foo
)
COOKIE: Array
(
)
</body> </html>
===== type bar, hit submit. Note same session IDs =====
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a Request: Array ( [PHPSESSID] =>
7c6cd5d1f965de3f134442600f60565a [field] => bar )
GET: Array ( [PHPSESSID] => 7c6cd5d1f965de3f134442600f60565a ) POST: Array ( [field]
=> bar ) COOKIE: Array ( )
<html>
<head><title>PHP Test page</title></head>
<body>
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a <form method="post"
action="xxx.php?PHPSESSID=7c6cd5d1f965de3f134442600f60565a">
<input type="text" maxlength="7" size="7" name="field" value="bar">
<input type="submit" value="Submit">
</form>
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a Request: Array
(
[PHPSESSID] => 7c6cd5d1f965de3f134442600f60565a
[field] => bar
)
<br>GET: Array
(
[PHPSESSID] => 7c6cd5d1f965de3f134442600f60565a
)
POST: Array
(
[field] => bar
)
COOKIE: Array
(
)
</body> </html>
php code:
<?
@session_start();
if (!isset($_SESSION['stage'])) {
$_SESSION['stage'] = 0;
}
if (!isset($_POST['field'])) { $_POST['field'] = ""; }
?>
<html>
<head><title>PHP Test page</title></head>
<body>
<?
echo "Stage:"; echo $_SESSION['stage'];
echo " SessionID: "; echo session_id();
$_SESSION['stage'] = 1;
?>
<form method="post" action="xxx.php?<?= SID; ?>">
<input type="text" maxlength="7" size="7" name="field" value="<?echo
$_POST['field']?>">
<input type="submit" value="Submit">
</form>
<?
echo "Stage:"; echo $_SESSION['stage']; echo " ";
echo " SessionID: "; echo session_id(); echo " ";
echo " Request: "; print_r($_REQUEST);
echo "<br>GET: "; print_r($_GET); echo " POST: "; print_r($_POST); echo " COOKIE: ";
print_r($_COOKIE);
?>
</body> </html>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php