Add /usr/login welcome screen Drupal8 newbie here (using better login and system caching is on), 

I wanted to just add a php page before the login page that says something like :

"Please follow the rules of our site, click accept button to agree and login in:"

                                   [Accept Button]


After pressing the button it forwards you to the normal /user/login page. Any tips would be great, it seems harder than it should be, we really don't want to use JQuery/JS.
You can do this by creating a custom module:
Example:


MODULE_NAME(mydata)
creat routing file. (mydata.routing.yml):

     mydata.redirect_form:
       path: '/user/redirect'
       defaults:
         _form: '\Drupal\mydata\Form\RedirectForm'
         _title: 'Redirect User'
       requirements:
         _permission: 'access content'

Create .module file (mydata.module):

use Symfony\Component\HttpFoundation\RedirectResponse;
use Drupal\Core\Url;

function mydata_preprocess_page(&amp;$var){
    if(empty($_SESSION['terms_accepted']) || $_SESSION['terms_accepted'] != 'ok'){
        if (\Drupal::routeMatch()-&gt;getRouteName() == "user.login"){
            $path = Url::fromRoute('mydata.redirect_form', [], ['absolute' =&gt; TRUE])-&gt;toString();
            $response = new RedirectResponse($path);
            return $response-&gt;send();

        }
    }
}

Create file in module folder src/Form/RedirectForm.php:

namespace Drupal\mydata\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\RedirectResponse;

class RedirectForm extends FormBase {

    public function getFormId() {
        return 'redirect_form';
    }

    public function buildForm(array $form, FormStateInterface $form_state) {
        if(!empty(@$_SESSION['terms_accepted']) || @$_SESSION['terms_accepted'] == 'ok'){
            $path = Url::fromRoute('user.login', [], ['absolute' =&gt; TRUE])-&gt;toString();
            $response = new RedirectResponse($path);
            return $response-&gt;send();
        }

        $form['test'] = [
            '#type' =&gt; 'item',
            '#markup' =&gt; t('Please Follow the rule of our site,click accept button to agree and login-in: '),
        ];

        $form['submit'] = [
            '#type' =&gt; 'submit',
            '#value' =&gt; 'Accept',
        ];

        return $form;

      }

    public function submitForm(array &amp;$form, FormStateInterface $form_state) {
        $_SESSION['terms_accepted'] = 'ok';
        if($_SESSION['terms_accepted']){
            $form_state-&gt;setRedirect('user.login');
        }
    }
}