Bluehost.com Web Hosting $6.95

session_destroy causes backspace on IE

This is a discussion on session_destroy causes backspace on IE within the PHP General forums, part of the PHP Programming Forums category; The following code causes IE to break the </h1> tag. <?php session_start(); header("Cache-control: private&...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-24-2003
Bill
 
Posts: n/a
Default session_destroy causes backspace on IE

The following code causes IE to break the </h1> tag.

<?php
session_start();
header("Cache-control: private");
echo "<html>
<head><title>logout</title>
</head>
<body>
<h1 align=\"center\">Logout page</h1>";
$_SESSION = array();
session_destroy();
echo "<p>Session destroyed</p>\n";
echo "</body>
</html>\n";
?>

View/Source in IE: displays this (note </h1> broken):

<html>
<head><title>logout</title>
</head>
<body>
<h1 align="center">Logout page</<p>Session destroyed</p>
</body>
</html>
h1>

Details: Works fine in other browsers I've tried, and this version of IE
(5.5) does -not- have cookies enabled.

Any ideas?
Reply With Quote
  #2 (permalink)  
Old 10-24-2003
Eugene Lee
 
Posts: n/a
Default Re: [PHP] session_destroy causes backspace on IE

On Fri, Oct 24, 2003 at 01:24:32PM -0400, bill wrote:
:
: The following code causes IE to break the </h1> tag.
:
: <?php
: session_start();
: header("Cache-control: private");
: echo "<html>
: <head><title>logout</title>
: </head>
: <body>
: <h1 align=\"center\">Logout page</h1>";
: $_SESSION = array();
: session_destroy();
: echo "<p>Session destroyed</p>\n";
: echo "</body>
: </html>\n";
: ?>
:
: View/Source in IE: displays this (note </h1> broken):
:
: <html>
: <head><title>logout</title>
: </head>
: <body>
: <h1 align="center">Logout page</<p>Session destroyed</p>
: </body>
: </html>
: h1>
:
: Details: Works fine in other browsers I've tried, and this version of IE
: (5.5) does -not- have cookies enabled.

Besides tossing out IE? :-)

Try splitting your big echo() statement into smaller pieces and see what
happens.

echo '<html>'."\n";
echo '<head><title>logout</title>'."\n";
echo '</head>'."\n";
echo '<body>'."\n";
echo '<h1 align="center">Logout page</h1>'."\n";
Reply With Quote
  #3 (permalink)  
Old 10-24-2003
Bill
 
Posts: n/a
Default Re: [PHP] session_destroy causes backspace on IE

Hi Eugene,

Tried breaking up the echo, but still didn't work.

<?php
session_start();
header("Cache-control: private");
echo "<html>";
echo "<head><title>logout</title>";
echo "</head>";
echo "<body>";
echo "<h1 align=\"center\">Logout page</h1>";
$_SESSION = array();
session_destroy();
echo "<p>Session destroyed</p>\n";
echo "</body>
</html>\n";
?>

I know it is the session_destroy() command because commenting it out the
problem goes away.

kind regards,

bill

Eugene Lee wrote:

>On Fri, Oct 24, 2003 at 01:24:32PM -0400, bill wrote:
>:
>: The following code causes IE to break the </h1> tag.
>:
>: <?php
>: session_start();
>: header("Cache-control: private");
>: echo "<html>
>: <head><title>logout</title>
>: </head>
>: <body>
>: <h1 align=\"center\">Logout page</h1>";
>: $_SESSION = array();
>: session_destroy();
>: echo "<p>Session destroyed</p>\n";
>: echo "</body>
>: </html>\n";
>: ?>
>:
>: View/Source in IE: displays this (note </h1> broken):
>:
>: <html>
>: <head><title>logout</title>
>: </head>
>: <body>
>: <h1 align="center">Logout page</<p>Session destroyed</p>
>: </body>
>: </html>
>: h1>
>:
>: Details: Works fine in other browsers I've tried, and this version of IE
>: (5.5) does -not- have cookies enabled.
>
>Besides tossing out IE? :-)
>
>Try splitting your big echo() statement into smaller pieces and see what
>happens.
>
> echo '<html>'."\n";
> echo '<head><title>logout</title>'."\n";
> echo '</head>'."\n";
> echo '<body>'."\n";
> echo '<h1 align="center">Logout page</h1>'."\n";
>
>

Reply With Quote
  #4 (permalink)  
Old 10-25-2003
David Otton
 
Posts: n/a
Default Re: [PHP] session_destroy causes backspace on IE

On Fri, 24 Oct 2003 15:42:45 -0400, you wrote:

>Tried breaking up the echo, but still didn't work.


What PHP version are you using? 4.10, maybe?

http://bugs.php.net/bug.php?id=14695
Reply With Quote
  #5 (permalink)  
Old 10-25-2003
Bill
 
Posts: n/a
Default Re: [PHP] session_destroy causes backspace on IE

Aha, I'm using PHP 4.1.2 with trans-sid enabled for browsers that don't
use cookies.

Now that I know where to look, I found that putting ob_start() at the
beginning seems to help.

kind regards,

bill

David Otton wrote:

>On Fri, 24 Oct 2003 15:42:45 -0400, you wrote:
>
>
>
>>Tried breaking up the echo, but still didn't work.
>>
>>

>
>What PHP version are you using? 4.10, maybe?
>
>http://bugs.php.net/bug.php?id=14695
>
>


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 02:10 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0