I have created a LoginPage.php with the following code

```
<?
session_start();
if (isset($_SESSION['uid']))
{
    header('Location: index.php');          
}   
?>
 <!DOCTYPE html>
  <html>
   <head>
    <?php 
    include("indexhead.php"); 
    ?>
    </head>
<body>
    <?php
        include("myCarousel.php");
        echo "
        <div class='container'>
            <div class='row'>
                <div class='col-sm-6 col-md-4 col-md-offset-4'>

                 <h1 class='text-center login-title'>Sign in to continue:</h1>
                    <div class='account-wall'>

                        <form class='form-signin' method='POST'>

                            <input name='uid' type='text' class='form-control' 
                            placeholder='Username' required autofocus >
                            <input name='pass' type='password' class='form-control' 
                            placeholder='Password' required >

                            <button class='btn btn-lg btn-primary btn-block' type='submit'>
                            Sign in</button>

                        </form>
                    </div>

                </div>
            </div>
        </div>
         ";

    if (isset($_POST['uid']) and isset($_POST['pass']))
    {
        if (empty($_POST['uid']) or empty($_POST['pass']))
        { 
            echo "Please type data into the login";                 
        }
        else
        {
                $uname = stripslashes($_POST['uid']);
                $pass = stripslashes($_POST['pass']);
                $nick = selectSpecific("select nickName from hera.LoginTable where uid ='".$uname.
                "' and pass = md5('".$pass."');");
                if ($nick != '')
                {
                    $_SESSION['Nick1'] = selectSpecific("select nickName from hera.LoginTable where uid ='".$uname.
                    "' and pass = md5('".$pass."');");

                    $_SESSION['FullName'] = selectSpecific("select FullName from hera.LoginTable where uid ='".$uname.
                    "' and pass = md5('".$pass."');");

                    $_SESSION['dept'] = selectSpecific("select dept from hera.LoginTable where uid ='".$uname.
                    "' and pass = md5('".$pass."');");

                    $_SESSION['accesslevel'] = selectSpecific("select accesslevel from hera.LoginTable where uid ='".$uname.
                    "' and pass = md5('".$pass."');");

                    $_SESSION['uid'] = selectSpecific("select uid from hera.LoginTable where uid ='".$uname.
                    "' and pass = md5('".$pass."');");

                    header("Location: index.php");
                    //echo $_SESSION['Nick1'];

                }
                else
                {
                    echo "Unknown Username/Password";
                }
        }   
    }   
 ?> 
 </body>
</html>

```

what it does is to check the login and when the login is successful the user is lead to the index.php of the website

however, The index.php page does not detect the $\_SESSION[''] variables, namely `$_SESSION['uid']` it says : Notice: Undefined index: uid in C:\xampp\htdocs\Hera\index.php on line 14

But I can confirm that the session variable does receive content from function selectSpecific(). Why is it not being held by the session? 

here is the code for the index.php

```
<?php
    session_start();

    echo $_SESSION['uid'];

?>

```