session_start();
$_SESSION['login']=1;
Also i tried this with cookies . As well tried on different servers. Code working on local but not on live servers.Could you please tell me why this is happening.Please give the solution of it.
session_start();
$_SESSION['login']=1;
Also i tried this with cookies . As well tried on different servers. Code working on local but not on live servers.Could you please tell me why this is happening.Please give the solution of it.
Make sure your temp path has write permission.
In your file, write below lines to check session is set or not.
session_start();
if(isset($_SESSION['login']) && !empty($_SESSION['login'])) {
echo $_SESSION['login'];
}else{
echo 'session not set';
}
Note:- You need to call session_start()
on all your pages.
Hope it will help you :)