I wanna ask the checking session login in PHP language. I mean:

On basic, After user login on the website, I will start the sesssion:

```
$_session['memberName'] = $member['Firstname'];

```

**Note**: $member is an array that query from the DB. Firstname is a column in DB.

when I don't want user access to the profile.php page without LOGIN. I will set the condition in profile.php file is:

```
session_start();
if($_SESSION['memberName'] == "")
{
redirectMsg('You must login to access this page','login.php');
}

```

**Note**: redirectMsg() is the function that I have written for using Javascript to announce the message and redirect to some page.

That way is too difficult to control. That mean I have to add that code for each page I want to...when I change something about that, that will take more time...

Now I want to have a file to control that session, I can change the value but it will not take time...How can I do that...please direct the way for me...OR

Have anybody have other solutions to solve, please help me.