• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
set_cookie & redirect() didn't work

#3
Thanks kilishan . I changed to set the cookie on the response object and it still didn't work with the redirect(). I have to set the header on the response object for redirecting

So, I changed from:
PHP Code:
set_cookie('login'md5($this->request->getVar('password')), time() + 86400);
return 
redirect()->to('/'); 

To:
PHP Code:
$this->response->setCookie('login'md5($this->request->getVar('password')), time() + 86400)->setHeader('Location''/'); 

Also, $this->response->deleteCookie('login') didn't work so I have to use:
PHP Code:
$this->response->setCookie('login''')->setHeader('Location''/'); 

Is this the correct way to do like this?
Reply


Messages In This Thread
RE: set_cookie & redirect() didn't work - by zjonsnowz - 05-09-2019, 02:59 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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