app/Customize/Controller/SessionController2.php line 14

Open in your IDE?
  1. <?php
  2. namespace Customize\Controller;
  3. use Eccube\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  7. class SessionController2 extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/set-session2/{id}", name="set_session2")
  11.      */
  12.     public function setCustomSession2(SessionInterface $sessionstring $id): Response
  13.     {
  14.         // セッションに値を設定
  15.         $session->set('blb_id2'$id);
  16.         // リダイレクトする先のルートに飛ぶ
  17.         // return $this->redirect('https://tpscoco.com/user_data/news_list');
  18.         return $this->redirect('/user_data/news');
  19.     }
  20. }