title: PHP - Sessions and Controllers
body: <p>If I may ask, I would like to ask about "sessions", "controllers" and "session controllers".</p>
  
  <p>So let's start at the beginning: I have heard of MVC and tried it in C# (VS), but while I could grasp the concept, I didn't understand implementation. It all seemed so strange. Now in PHP the concept became even more clear.</p>
  
  <p>Now I would like to ask whether or not a "session controller" is like a controller for the session. It seems straight forward, in wording, but maybe I have it wrong. Although I would preferably not implement MVC in the current project I am working on, yet I would like to perform some sort of "controller" that manages groupings of session content.</p>
  
  <p>Although I would like to ask if it is possible to have the following script in your application:</p>
  
  <pre><code>//path: c:/xampp/htdocs/starvationproject/root/index.php
  &lt;?php
       include '../session/controller.php';
  ?&gt;
  &lt;!DOCTYPE..........
  
  
  //path: c:/xampp/htdocs/starvationproject/session/controller.php
  //I have not coded this script yet, but it will perform tasks like
  //setting the user, session variables etc.
  &lt;?php
       session_start();
  ?&gt;
  // An important question here. If I include this file in the previous, can
  // I safely say that the session has been started in index because of the
  // include, or do you have to manually type out session_start(); 
  // in each page?
  </code></pre>
  
  <p>Lastly, I would like to ask if this file structure is correct or not, or rather if it is standard or nor, or whatever:</p>
  
  <p><a href="https://i.stack.imgur.com/B9TvE.png" rel="nofollow noreferrer">Folder Structure</a>
  , where "multi" (as you can see) has a page named after each folder in "partial", where what I did is, based on the get request of the page in "multi", I included a partial, i.e:</p>
  
  <pre><code>if ($_GET['q'] == 'Add') {
      include '../partial/stockAct/add.php';
  }
  else if ($_GET['q'] == 'Update') {
      include '../partial/stockAct/update.php';
  }
  </code></pre>
  
  <p>And then those "partial" files only held like a <code>section</code> with a <code>form</code> or something like that. As in the tv stays where it is, I'm just switching channels. </p>