Error in Sessions

Submitted by sencioanne on
Hi, maybe this is just very easy for you guys but its kinda problematic to me as I am new in php, but I was getting this error of undefined index in the session variable every time the variable is empty. I already put if else statement. The flow is like this, I want that status div will show a link of login and register here when the user in not logged in, but if it does then the status area must show the username of the logged in user as a link to access its profile. Please, help me. Still starting so I'm still expecting more questions later. Thanks in advance. God Bless.