PHP session value defined in one file, is undefined in another file -


i have 2 php files, in first file:

    <?php         session_start();     . . .         $_session['favcolor'] = "green";         echo "ses: ".$_session['favcolor'];     ?> 

and in second file:

<?php     session_start();     echo "ses: ".$_session['favcolor']; ?> 

when executing first page, see correct favcolor when executing second page in same browser, {"error":"undefined index: favcolor"}. know need check existence of key before using wondering why it's not there in first place because want achieve, store/restore session value between php calls. missing?


Comments

Popular posts from this blog

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -