Zen Cart Logo
Forums / General Questions / Couple of new error messages

Couple of new error messages

Views: 964

Results 1 to 4 of 4
5 Feb 2014, 2:16 AM
#1
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Couple of new error messages

[04-Feb-2014 18:08:30 America] PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at /public_html/includes/templates/MyTemplate/common/tpl_header.php:51) in /public_html/includes/languages/english/html_includes/MyTemplate/define_main_page.php on line 14

[04-Feb-2014 18:08:30 America] PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /public_html/includes/templates/MyTemplate/common/tpl_header.php:51) in /public_html/includes/languages/english/html_includes/MyTemplate/define_main_page.php on line 14

Does anyone know what these error messages mean?

5 Feb 2014, 3:10 AM
#2
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Couple of new error messages

Kevin205:

[04-Feb-2014 18:08:30 America] PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /public_html/includes/templates/MyTemplate/common/tpl_header.php:51) in /public_html/includes/languages/english/html_includes/MyTemplate/define_main_page.php on line 14

[04-Feb-2014 18:08:30 America] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /public_html/includes/templates/MyTemplate/common/tpl_header.php:51) in /public_html/includes/languages/english/html_includes/MyTemplate/define_main_page.php on line 14

> 
> Does anyone know what these error messages mean?Take a look at

includes/templates/MyTemplate/common/tpl_header.php
at line 51 and see whats happening around that line
Compare it an unedited version.
5 Feb 2014, 6:54 PM
#3
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Couple of new error messages

gilby:

Take a look at

includes/templates/MyTemplate/common/tpl_header.php
at line 51 and see whats happening around that line
Compare it an unedited version.

I am thinking the problem is coming from includes/languages/english/html_includes/MyTemplate/define_main_page.php
I have added a "onload popup" Jquery for a message to display once per browser session in define_main_page.php. This jQuery is using:

<?php session_start(); ?> // Line 14
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
	<?php 
	if(!isset($_SESSION['jquery_popup']))  { 
	$_SESSION['jquery_popup'] = 1;
	?>

I believe the above it is somehow conflicting with ZC's sessions! If I remove the following from line 14

<?php session_start(); ?>

The window pops up every time the page is refreshed.

Can't figure out how to go around it!

5 Feb 2014, 11:55 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Couple of new error messages

Kevin205:

I am thinking the problem is coming from includes/languages/english/html_includes/MyTemplate/define_main_page.php
I have added a "onload popup" Jquery for a message to display once per browser session in define_main_page.php. This jQuery is using:

<?php session_start(); ?> // Line 14 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<?php 
if(!isset($_SESSION['jquery_popup']))  { 
$_SESSION['jquery_popup'] = 1;
?>
> 
> I believe the above it is somehow conflicting with ZC's sessions!  If I remove the following from line 14
> ```php
<?php session_start(); ?>

The window pops up every time the page is refreshed.

Can't figure out how to go around it!

So it seems to me this, then. In the header the session is started, but the check for the setting of the session variable is not included. Then in the main body, the check is done, but where is the verification that if the session variable is not set to load the script? I would think would want it in the same group as the original check:

If session(variable) is not set {
?>Script text <?php
Set session variable
}

As "generic" code.