Welcome Guest, Not a member yet? Register   Sign In
bug at redirect at CI4
#1

(This post was last modified: 06-20-2020, 05:38 PM by jreklund.)

problem when use redirect at filter:

PHP Code:
public function before(RequestInterface $request)
    {
        helper('url');
        $session Services::session();
        $isLoggedIn=session()->get('isLoggedIn');
        if(isset($isLoggedIn)){
        route_to('/home');
    }
        else {
return 
redirect()->to(site_url('Users/index'));


Reply
#2

Have nothing to add to the subject at hand. Please don't make two threads and bump a thread with four posts. All posts are getting moderated for new user, just to avoid spam. These posts and the extra thread have been deleted.
Reply
#3

(06-20-2020, 04:35 PM)malsmary Wrote: problem when use redirect at filter:

PHP Code:
public function before(RequestInterface $request)
    {
        helper('url');
        $session Services::session();
        $isLoggedIn=session()->get('isLoggedIn');
        if(isset($isLoggedIn)){
        route_to('/home');
    }
        else {
return 
redirect()->to(site_url('Users/index'));



And what exactly is the problem?
Reply
#4

(06-21-2020, 09:43 AM)dave friend Wrote:
(06-20-2020, 04:35 PM)malsmary Wrote: problem when use redirect at filter:

PHP Code:
public function before(RequestInterface $request)
    {
        helper('url');
        $session Services::session();
        $isLoggedIn=session()->get('isLoggedIn');
        if(isset($isLoggedIn)){
        route_to('/home');
    }
        else {
return 
redirect()->to(site_url('Users/index'));



And what exactly is the problem?
I'm having problems implementing a site-wide Filter redirection for maintenance.  As you can see, I've tried to brute-force it using the infinite monkey theorem, but even this hasn't helped.
Reply
#5

(06-21-2020, 12:48 PM)malsmary Wrote: problem when use redirect at filter:

PHP Code:
public function before(RequestInterface $request)
    {
        helper('url');
        $session Services::session();
        $isLoggedIn=session()->get('isLoggedIn');
        if(isset($isLoggedIn)){
        route_to('/home');
    }
        else {
return 
redirect()->to(site_url('Users/index'));



I'm having problems implementing a site-wide Filter redirection for maintenance.  As you can see, I've tried to brute-force it using the infinite monkey theorem, but even this hasn't helped.


I don't believe route_to() does what you expect. Try replacing that call with

PHP Code:
return redirect('home')); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB