0

I am starting the session in dbconnect.php .The session variable is carrying over to home.php on my localhost but when i am hosting it on a webserver the session variable is not carrying over.

checklogin.php

<?php 

session_start(); 
$username = $_POST['username'] ;   
$_SESSION['user'] = $username ; 
// other code 
?>

home.php

<?php 
session_start();  
$user = $_SESSION['user'] ;  
echo $user;
// other code 
?>
4

0 回答 0