Session Error

This is a discussion on Session Error within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, the following php-snippet: <? // Fahrzeugverwaltung // index.php session_start(); // user-check if (!isset($_SESSION['status'])) { session_write_close(); header("Location: ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-25-2006
Michael Maus
 
Posts: n/a
Default Session Error

Hi,

the following php-snippet:

<?
// Fahrzeugverwaltung
// index.php
session_start();

// user-check
if (!isset($_SESSION['status']))
{
session_write_close();
header("Location: login.php");
}

[...]

?>

produces:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /kunden/crea.de/webseiten/kunden/hmwa/index.php:1) in //webseiten/kunden/index.php on line 4

(Linux System)

I don't see, where a "<?" or two comment-lines could cause a header-output?

Thank you for any help!



Reply With Quote
  #2 (permalink)  
Old 07-25-2006
David Haynes
 
Posts: n/a
Default Re: Session Error

Michael Maus wrote:
> Hi,
>
> the following php-snippet:
>
> /<?
> // Fahrzeugverwaltung
> // index.php
> session_start();/
> //
> /// user-check
> if (!isset($_SESSION['status']))
> {
> session_write_close();
> header("Location: login.php");
> }/
> //
> /[...]/
>
> /?>/
>
> produces:
>
> /Warning: session_start() [//function.session-start/
> <http://www.crea.de/kunden/hmwa/function.session-start?PHPSESSID=5b6f958962576f38bbee30f991d04c3e>/]:
> Cannot send session cache limiter - headers already sent (output started
> at /kunden/crea.de/webseiten/kunden/hmwa/index.php:1) in
> //webseiten/kunden/index.php on line 4/
>
> (Linux System)
>
> I don't see, where a "<?" or two comment-lines could cause a header-output?
>
> Thank you for any help!
>

Do you have short tags enabled in your php.ini?
If not, <? should be <?php and <? would be the start of output.

-david-

Reply With Quote
  #3 (permalink)  
Old 07-26-2006
Michael Maus
 
Posts: n/a
Default Re: Session Error

"David Haynes" <david.haynes2@sympatico.ca> schrieb im Newsbeitrag
news:ZZtxg.13308$Sc.8406@fe23.usenetserver.com...
> Michael Maus wrote:
> > Hi,
> >
> > the following php-snippet:
> >
> > /<?
> > // Fahrzeugverwaltung
> > // index.php
> > session_start();/
> > //
> > /// user-check
> > if (!isset($_SESSION['status']))
> > {
> > session_write_close();
> > header("Location: login.php");
> > }/
> > //
> > /[...]/
> >
> > /?>/
> >
> > produces:
> >
> > /Warning: session_start() [//function.session-start/
> >

<http://www.crea.de/kunden/hmwa/funct...ID=5b6f9589625
76f38bbee30f991d04c3e>/]:
> > Cannot send session cache limiter - headers already sent (output started
> > at /kunden/crea.de/webseiten/kunden/hmwa/index.php:1) in
> > //webseiten/kunden/index.php on line 4/
> >
> > (Linux System)
> >
> > I don't see, where a "<?" or two comment-lines could cause a

header-output?
> >
> > Thank you for any help!
> >

> Do you have short tags enabled in your php.ini?
> If not, <? should be <?php and <? would be the start of output.
>
> -david-


Thank you David - but (unfortunaly) the short tag in on.


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 08:56 PM.


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