php - $_SESSION variables not passing between files -


i've got login script puts user details session variables. today moved website new host, , coding doesn't work. best can do, , still doesn't work

main_login.php:

(script above here gets $info database. far working) if($count==1){     session_start();     $_session['username'] = $info['username'];     $_session['given'] = $info['given_name'];     $_session['family'] = $info['family_name'];     $_session['profile'] = $info['profile'];     $_session['adultchild'] = $info['adultchild'];     $_session['id'] = $info['id'];     header("location:welcome.php"); } 

welcome.php:

// check if session not registered , redirect main page.  // put code in first line of web page.  session_start(); if(!isset($_session['username'])){     header("location:main_login.php"); } 

the trouble when print of session variables nothing happens. i've tried doing var_dump($_session) comes empty array. frankly i've spent day on , stuck.

session_start(); if(!isset($_session['username']));     header("location:main_login.php"); } 

change to:

session_start(); if(!isset($_session['username'])){ //                               ^ typing mistake     header("location:main_login.php"); } 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -