Currently I have a problem with setting up a session variable. 

```
    <?php

session_start();

if( isset($_SESSION['user_id']) ){
    header("Location: home.php");
}

require 'pdoconnect.php';

if(!empty($_POST['email']) && !empty($_POST['password'])):

    $records = $conn->prepare('SELECT id,email,password FROM users WHERE email = :email');
    $records->bindParam(':email', $_POST['email']);
    $records->execute();
    $results = $records->fetch(PDO::FETCH_ASSOC);

    $message = '';

    if(count($results) > 0 && password_verify($_POST['password'], $results['password']) ){

        $_SESSION['user_id'] = $results['id'];
        header("Location: glogin.php");
        $_SESSION['email'] = $_POST['email'];
        $email = $_SESSION['email'];

    } else {
        $message = 'Login failed, try again';
    }

endif;

```

Above you can see the login script that I'm using, this code is running at 

> 
> login.php
> 
> 
> 

```
<form action="login.php" method="POST">

<input type="email" placeholder="Enter your e-mail" name="email" required>
<input type="password" placeholder="Enter your password" name="password" required>

<input type="submit" value="Log in">

<?php if(!empty($message)): ?>
<p><?= $message ?></p>
<?php endif; ?> 

</form>

```

And this is the form that is used to login, the form is also running at 

> 
> login.php
> 
> 
> 

Now the problem comes, I want to put the email that the user used to login into a session variable, but I can't set the form action to a other page because then the login script will not work anymore. 

So my question is: 'How do I read $\_SESSION['email'] without changing the form action? 

I already tried to include login.php into a other page but didn't work unfortunately.