php session_start() warning

Posted by Eniasharmila Karunakaran on Stack Overflow See other posts from Stack Overflow or by Eniasharmila Karunakaran
Published on 2012-04-15T04:25:25Z Indexed on 2012/04/15 5:29 UTC
Read the original article Hit count: 195

Filed under:
|
|

I'm new to php.. Im trying to get value from session. Below is my code.

Set session in login page

session_start(); 
$_SESSION["username"] = $username ; 
$_SESSION["password"] = $password ; 
$_SESSION["companycode"] = $companycode;

Get the session

if(! isset($_SESSION))
session_start();  
$a=$_SESSION["companycode"];
echo $a;

But i got the warning in my page:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\lucent\clientlogin.php:216) in C:\xampp\htdocs\lucent\clientlogin.php on line 219
Please help. Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about session