Guest User

Untitled

a guest
Oct 23rd, 2019
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace App\Http\Controllers;
  4. use Cookie;
  5. use Illuminate\Http\Request;
  6. use Illuminate\Http\Response;
  7. class TestCookie extends Controller
  8. {
  9. public function index (Response $resp){
  10. $minutes = 1;
  11. $resp->withCookie(cookie('name', 'vsk', $minutes));
  12. return $resp;
  13. }
  14.  
  15. public function getCookie(Request $req) {
  16. $value = $req->cookie('name');
  17.  
  18. $cookies = Cookie::get();
  19. foreach($cookies as $val) {
  20. echo $val ."<br>";
  21. }
  22. echo $value;
  23. }
  24.  
  25. }
RAW Paste Data