cannot set a variable to base on user input post method
<p>Hello i´m trying to set info from a post method into a variable that sets a session named name the value that the user input. I get the following error:</p>

<blockquote>
  <p>Notice: Undefined index: name in F:\xampp\htdocs\Impossible game\index.php on line 18</p>
  
  <p>This is line 18: $session = $_POST['name'];</p>
</blockquote>

<pre><code>&lt;form action="ms1.php" method="POST"&gt;
Name &lt;input type="text" name="name"&gt;
&lt;input type="Submit" value="Begin"&gt;
&lt;/form&gt;
&lt;?php
$session = $_POST['name']; 
session_start();
$_SESSION['name'] = $session;
</code></pre>

<p>the previous error is gone and now this appears</p>

<blockquote>
  <p>Notice: Undefined variable: session in F:\xampp\htdocs\Impossible game\index.php on line 23 below is line 23</p>
</blockquote>

<pre><code> $_SESSION['name'] = $session;
</code></pre>
