Link to home
Create AccountLog in
Avatar of Dean OBrien
Dean OBrienFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Warning: session_start() [function.session-start]: Cannot send session cookie

Experts,

I have moved a new site from a development server to the live server and am getting problems (not present on dev server).

PHP seems to be complaining about the use of session_start() function. I have searched the web looking for answers and each thread seems to imply it is due to having space in php file before calling the function, however, i definitely dont have any space....

http://www.claibon.co.uk/february13/login.php

Here is the top half of the code:

<?php
session_start();
if (isset($_GET['task'])) {
	$task=$_GET['task'];	
} else {
    	$task="login";
}
?>
<!doctype html>  
<html lang="en">  
<head>
  <meta charset="utf-8" />
  <title>Claibon Recruitment</title> 
  <meta name="description" content="Claibon Recruitment" />
  <meta name="author" content="Sure Media">
  <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400' rel='stylesheet' type='text/css'>
  <link href="css/style.css" rel="stylesheet" type="text/css" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <!--[if lt IE 9]>  
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>  
  <![endif]-->
  <link rel="shortcut icon" href="flavicon.ico" />
</head>
<body>
<div id="container" itemscope itemtype="http://data-vocabulary.org/Organization">
	<header>
		<div id="contact">
			GET IN TOUCH: 

Open in new window


Any suggestions on how to resolve this would be greatly appreciated

Easynow
SOLUTION
Avatar of Ahmed Merghani
Ahmed Merghani
Flag of Sudan image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of Dean OBrien

ASKER

Thanks for comments.

It appears it was indeed down to encoding.

I confess to know very little about character encoding.. i add the meta tag to state utf-8 and save as utf-8 in notepad normally.

The only way i was able to get this working just now was to save as ANSI... any ideas why? should i change character encoding tags within doc?

Will close and award points very shortly.

Thanks for solution.
Regards
Easynow
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Thanks for the info guys