I am trying to pass a value using session from one page to another but it says
Notice: Undefined index: user_id in path\file.php on line 61
// checking for session, if not then start session
// assigning user_id to session var
// trying to access session var (previously defined)
It should be $_SESSION not $_session.
$_SESSION['user_id']=$row['user_id']; $user_id = $_SESSION['user_id'];
$_SESSION is a global variable and should be written in capital. When you are using the variable with small letters, in that case it doesn't get the variable because its never been defined and doesn't have the key
user_id and hence you get the error. Hope this helps.