cookie.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | Cookie设置
  13. // +----------------------------------------------------------------------
  14. return [
  15. // cookie 保存时间
  16. 'expire' => 0,
  17. // cookie 保存路径
  18. 'path' => '/',
  19. // cookie 有效域名
  20. 'domain' => '',
  21. // cookie 启用安全传输
  22. 'secure' => false,
  23. // httponly设置
  24. 'httponly' => false,
  25. // 是否使用 setcookie
  26. 'setcookie' => true,
  27. // 跨域header
  28. 'header' => [
  29. 'Access-Control-Allow-Origin' => '*',
  30. 'Access-Control-Allow-Headers' => 'App-id, Sign, Sign-time, Ex-U, Badmin-Authori-zation, Authori-zation, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With',
  31. 'Access-Control-Allow-Methods' => 'GET,POST,PATCH,PUT,DELETE,OPTIONS,DELETE',
  32. 'Access-Control-Max-Age' => '1728000',
  33. 'Access-Control-Allow-Credentials' => 'true'
  34. ],
  35. // token名称
  36. 'token_name' => 'Authori-zation',
  37. 'badmin_token_name' => 'Badmin-Authori-zation',
  38. 'md5_url' => 'Ex-U',
  39. ];