• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to start session globally?

#16
Photo 
It is correct that class extends from BaseController, I have commented the line parent ::__ construct () because if it does not throw me the error of: Cannot call constructor



PHP Code:
namespace App\Controllers;
use 
App\Models\Modeloejemplo;
class 
Demo extends BaseController
{
public function 
__construct(){
 
//parent::__construct();
 //establezco la zona horario par El Salvador
 
date_default_timezone_set('America/El_Salvador');
 
//comprobamos si el usuario está logueado
 
$this->sesion session();
 if(
$this->sesion->chequear != true)
 {
 
//si no estoy logueado que me envie a index
 
return redirect()->to(base_url());
 }
 
 
 }


Also, if I do not declare
PHP Code:
$this->session session(); 
the error throws me making a point that the session property is not defined
Reply


Messages In This Thread
How to start session globally? - by happyape - 09-21-2018, 04:35 AM
RE: How to start session globally? - by sv3tli0 - 09-21-2018, 04:59 AM
RE: How to start session globally? - by happyape - 09-21-2018, 05:21 AM
RE: How to start session globally? - by happyape - 09-21-2018, 05:34 AM
RE: How to start session globally? - by sv3tli0 - 09-21-2018, 06:10 AM
RE: How to start session globally? - by happyape - 09-21-2018, 06:16 AM
RE: How to start session globally? - by kilishan - 09-21-2018, 06:16 AM
RE: How to start session globally? - by happyape - 09-21-2018, 06:58 AM
RE: How to start session globally? - by happyape - 09-21-2018, 07:36 AM
RE: How to start session globally? - by macruzgi - 11-04-2019, 10:48 AM
RE: How to start session globally? - by macruzgi - 11-04-2019, 01:21 PM
RE: How to start session globally? - by kilishan - 09-21-2018, 09:21 AM
RE: How to start session globally? - by macruzgi - 11-04-2019, 01:29 PM
RE: How to start session globally? - by macruzgi - 11-04-2019, 03:05 PM
RE: How to start session globally? - by macruzgi - 11-05-2019, 07:51 AM
RE: How to start session globally? - by macruzgi - 11-08-2019, 04:17 PM
RE: How to start session globally? - by InsiteFX - 11-05-2019, 05:50 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.