Welcome Guest, Not a member yet? Register   Sign In
How can i move force_https in before filter
#1

(This post was last modified: 07-03-2020, 12:09 PM by cvlancvlan.)

How can i move force_https in before filter ? I wan't remove this force_https from system/Controller.php and i want add in filter.
I created an login sistem in filters where i recive informations from $_POST. In this case the redirect to https it will be done after i checked some informations from $_POST. I want first the redirect to be done.

I tried this but didn't work. app/GlobalFilter.php

PHP Code:
<?php namespace App\Filters;
use 
CodeIgniter\Filters\FilterInterface;
use 
CodeIgniter\HTTP\RequestInterface;
use 
CodeIgniter\HTTP\ResponseInterface

class 
GlobalFilter implements FilterInterface {
    
    protected 
$session;
    
    public function 
before(RequestInterface $requestResponseInterface $response) {

        
force_https(31536000$request$response);
    
   
    
}
    
    public function 
after(RequestInterface $requestResponseInterface $response) {
       
    
}
   


How can i override system/Controller.php ?
I tried copy this system/Controller.php in app/Controller.php folder but didn't work for me
Reply




Theme © iAndrew 2016 - Forum software by © MyBB