Is it safe for me to use in live website?
member.php
if($_SESSION['login'] == 1)
//member stuff
$_SESSION['login']
is set after user authenticate via login.php
In general: yes. You may want to set a bit more variables, but sessions are only available to php and not the user. The part where it gets exciting in terms of security is how you handle your authentication.
Yes, you should check if $_SESSION is set too.
if(isset($_SESSION['login'])) { ...
if($_SESSION['login'] == 1) { ...
It's safe as the $_SESSION
state is stored on your server, not sent back to the client.
Using sessions is better than using cookies when checking for logins/authentication since they can be altered as it communicates with the server from client side when session are only used for server side reading.