Jump to content

Recommended Posts

I am enabling a session at very 1st line of my php page

still it gives an warning

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\MyWebApp\index.php:1) in C:\xampp\htdocs\MyWebApp\index.php on line 1

 

index.php

<?php session_start();?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >

<head>

<title>Home - Home Page | Value-One (Technology with in Reach)</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<meta name="description" content="Place your description here" />

<meta name="keywords" content="put, your, keyword, here" />

<

 

 

still it gives an error.. and unable to work with session,, gone thru all header error pages

and I dont hv access to php.ini

Link to comment
https://forums.phpfreaks.com/topic/239228-cannot-send-session-cache-limiter/
Share on other sites

I know this may be a silly question but is "index.php" really above session_start in the file or are you signifying it here as index.php and you forgot to wrap your code in the code block?

 

That error you are receiving is only due to something somewhere some how outputting to your browser prior to that function even so much as hitting enter on the file so there's a bit of white space at the top.. or a space or literally anything output prior  to that session start will kill it.. Or, maybe your hosting co has sessions off for some odd reason?

Read reply #2 in this sticky thread - http://www.phpfreaks.com/forums/index.php?topic=37442.0

 

You either have some character(s) on the line before the <?php tag or your file has been saved with the BOM (Byte Order Mark) characters at the start of the file by your editor.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.