Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Session start error in IE7?

LEGEND ,
Feb 22, 2008 Feb 22, 2008
I have a page -

http://76.12.89.239/s_product-detail.php?ItemID=5&ItemSKU=01015

that contains the following on lines 8-12 -

<?php

if (!$_SESSION) { session_start(); }

?>

Why is that throwing an error?

Notice: A session had already been started - ignoring session_start() in
/vservers/squarewheeli/htdocs/s_product-detail.php on line 10

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


TOPICS
Server side applications
498
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2008 Feb 22, 2008
Actually, I see that error in all browsers. Whyzzat?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:fpmfpl$773$1@forums.macromedia.com...
>I have a page -
>
> http://76.12.89.239/s_product-detail.php?ItemID=5&ItemSKU=01015
>
> that contains the following on lines 8-12 -
>
> <?php
>
> if (!$_SESSION) { session_start(); }
>
> ?>
>
> Why is that throwing an error?
>
> Notice: A session had already been started - ignoring session_start() in
> /vservers/squarewheeli/htdocs/s_product-detail.php on line 10
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> ==================
>
>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2008 Feb 22, 2008
Murray *ACE* wrote:
> if (!$_SESSION) { session_start(); }

if (!isset($_SESSION)) {
session_start();
}

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2008 Feb 22, 2008
Thanks, David - I'll try that.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"David Powers" <david@example.com> wrote in message
news:fpmnsp$fkf$1@forums.macromedia.com...
> Murray *ACE* wrote:
>> if (!$_SESSION) { session_start(); }
>
> if (!isset($_SESSION)) {
> session_start();
> }
>
> --
> David Powers, Adobe Community Expert
> Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
> Author, "PHP Solutions" (friends of ED)
> http://foundationphp.com/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2008 Feb 22, 2008
Of course, it worked fine!

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:fpmqvh$isi$1@forums.macromedia.com...
> Thanks, David - I'll try that.
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> ==================
>
>
> "David Powers" <david@example.com> wrote in message
> news:fpmnsp$fkf$1@forums.macromedia.com...
>> Murray *ACE* wrote:
>>> if (!$_SESSION) { session_start(); }
>>
>> if (!isset($_SESSION)) {
>> session_start();
>> }
>>
>> --
>> David Powers, Adobe Community Expert
>> Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
>> Author, "PHP Solutions" (friends of ED)
>> http://foundationphp.com/
>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2008 Feb 22, 2008
.oO(Murray *ACE*)

>Of course, it worked fine!

But it shouldn't be necessary. Obviously you're calling session_start()
multiple times, which should be fixed.

Micha
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 27, 2008 Feb 27, 2008
i thought i was having the same problem but then i checked what david wrote and that is exactly what i already have but this is the error i am getting on my homepage:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/gradsrus/public_html/index.php:2) in /home/gradsrus/public_html/index.php on line 6

any idea?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2008 Feb 27, 2008
Yes. In your case, you have already sent output to the screen and that's
why you are getting the headers already sent message. Search here for
"headers already sent" to read more.

It may be as simple as just moving a line or two to a different location.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"lilbodi" <webforumsuser@macromedia.com> wrote in message
news:fq4343$65r$1@forums.macromedia.com...
>i thought i was having the same problem but then i checked what david wrote
>and
> that is exactly what i already have but this is the error i am getting on
> my
> homepage:
>
> Warning: session_start() [function.session-start]: Cannot send session
> cache
> limiter - headers already sent (output started at
> /home/gradsrus/public_html/index.php:2) in
> /home/gradsrus/public_html/index.php
> on line 6
>
> any idea?
>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 27, 2008 Feb 27, 2008
LATEST
i looked up what you mentioned and it only came up with three, one seemed to be on the same lines but didnt do the trick. what would i need to move around? or what do you think would fix it and/or a link i could go to?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines