Tagged: child theme, enfold, errors, functions.php, PHP errors, session_start
-
AuthorPosts
-
May 28, 2014 at 6:12 pm #271316
I’m received 3 error messages at the top of my browser…
Warning: session_start() [function.session-start]: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and ‘-,’ in /home1/msbllc/public_html/message/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php on line 33
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /home1/msbllc/public_html/message/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php:33) in /home1/msbllc/public_html/message/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php on line 33
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home1/msbllc/public_html/message/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php:33) in /home1/msbllc/public_html/message/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php on line 33
Anyone know what is causing this and a solution to resolve it? Please help!!
May 28, 2014 at 7:11 pm #271362Hey msbllc!
Please try to clear the browser cache and cookies for your website. It seems like the session cookie contains some invalid data and this data triggers the warning.
Best regards,
PeterMay 28, 2014 at 7:42 pm #271388Thanks Peter! It seems to be isolated to Chrome on an iPad. We tried clearing the browser cache and cookies from that and it still didn’t resolve it. What are your thoughts? I know it is very picky and mi-nute but our client is frantically upset.
May 29, 2014 at 7:14 am #271650Hi!
Thank you for the update.
Please try to add this on functions.php, place it at the very bottom:
function avia_session_start() { if (isset($_COOKIE['PHPSESSID'])) { $sessid = $_COOKIE['PHPSESSID']; } else if (isset($_GET['PHPSESSID'])) { $sessid = $_GET['PHPSESSID']; } else { session_start(); return false; } if (!preg_match('/^[a-z0-9]{32}$/', $sessid)) { return false; } session_start(); return true; }
Now, edit config-templatebuilder > avia-shortcodes > masonry_entries.php. Find this code on line 33:
if(!is_admin() && !current_theme_supports('avia_no_session_support') && !session_id()) session_start();
Replace it with:
if(!is_admin() && !current_theme_supports('avia_no_session_support') && !session_id()) avia_session_start();
Cheers!
IsmaelAugust 4, 2014 at 12:06 am #299462I set-up an enfold child theme folder and added the style.css and functions.php files per the enfold child theme tutorial. But I got a similar error message to the one msbllc was seeing:
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at …/public_html/message/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php:33) in …/public_html/message/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php on line 33
When I deleted the functions.php file in my child-theme folder, then everything was fine. (I have no need to customise php at this point, but I didn’t want the problem emerging later if I did!)
I subsequently found that I had prepared the functions.php file in the ‘design’ window of Dreamweaver and when I switched to the code window, Dw had added a lot of code in front. I deleted that and reloaded the functions.php file in my child theme folder and hey presto! the error message was gone….
August 4, 2014 at 9:54 am #299555Hey!
Sounds like the php file having the extra data was the cause of the issue so it shouldn’t happen again in your case.
Regards,
DevinMay 21, 2015 at 12:53 am #447475Hey, I have the same issue and tried all this steps, but the error ist still there :-(
I have the issue on two websites. One is an child-theme. the other one is the normal enfold Theme.
Warning: session_start() [function.session-start]: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and ‘-,’ in /www/htdocs/w0****/webstyle4you.com/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php on line 27
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /www/htdocs/w*****/webstyle4you.com/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php:27) in /www/htdocs/w*****/webstyle4you.com/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php on line 27
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /www/htdocs/*****/webstyle4you.com/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php:27) in /www/htdocs/w*****/webstyle4you.com/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php on line 27
May 21, 2015 at 12:58 am #447476okay – solved.
I added this code to the function.php on the bottom
add_theme_support(‘avia_no_session_support’);
-
AuthorPosts
- The topic ‘HELP!!! Trying to understand ERROR Message!!!!!’ is closed to new replies.