cookie.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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' => 'Authori-zation,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With, Form-type, Cb-lang, Invalid-zation',
  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. ];