Link to home
Start Free TrialLog in
Avatar of dprasad
dprasad

asked on

sessions

I'm trying to start a session for use on a number of pages. I get this error:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/dc/keywordeditor.php:8) in /var/www/html/dc/keywordeditor.php on line 15


What am I missing??

TIA Dinesh
Avatar of Diablo84
Diablo84

session_start();

must go before ANY output which includes:

- new lines or spaces before the opening php tag (<?php)
- html tags
- php output (including echo and print).

In an ideal situation session_start(); should be placed at the very top of your file before anything else
ASKER CERTIFIED SOLUTION
Avatar of Diablo84
Diablo84

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial