小编Den*_*nis的帖子

尽管时区有效,但设置默认时区不起作用

当我做phpinfo()时,我正在试图

警告:phpinfo():依赖系统的时区设置是不安全的.您需要使用date.timezone设置或date_default_timezone_set()函数.如果您使用了这些方法中的任何一种并且仍然收到此警告,则很可能拼错了时区标识符.我们在第8行的/myadmin/i.php中选择'EET/2.0/no DST'的'Europe/Helsinki'

这是i.php:

<?php
//echo date_default_timezone_get();

date_default_timezone_set("Europe/Kiev");

//echo date("l");

phpinfo();
?>
Run Code Online (Sandbox Code Playgroud)

正如你所看到的,当我做date_default_timezone_set("欧洲/基辅")时,我得到:

注意:date_default_timezone_set():时区ID'Europe/Kiev'在第4行的/myadmin/i.php中无效

我确定我从这里使用有效的时区字符串,我确实设置了:

date.timezone =欧洲/基辅

在php.ini文件中.

环境:CentOS 6,nginx/1.1.11,PHP 5.3.8(fpm-fcgi)

我真的无法理解什么是问题.谢谢.

php timezone centos centos6

6
推荐指数
1
解决办法
1万
查看次数

是否设置 cookie 'SameSite=none; 安全'并提供 CSRF-TOKEN 是否足以防止可嵌入 Web 应用程序中的 CSRF?

我的 Web 应用程序(进一步是 myApp)嵌入在单个第三方网页的 iframe 中。MyApp 设置 cookieSet-Cookie: JSESSIONID=38FE580EE7D8CACA581532DD37A19182; Path=/myapi; Secure; HttpOnly以维护用户会话。前一段时间它停止在 Chrome 中工作,因为https://blog.chromium.org/2020/02/samesite-cookie-changes-in-february.html更新更改了处理没有SameSite属性的cookie 的默认行为from Noneto Lax

  1. 我将从 myApp 主机发送 cookie 与SameSite=None; Secure. X-CSRF-TOKEN每个响应中还包含标头。myApp javascript 获取X-CSRF-TOKEN并将其放入对 myApp 主机的每个 XHR 请求的标头中。这足以防止CSRF攻击吗?

  2. 是否应该Access-Control-Allow-Origin: third-party-webpage在响应中添加标头?

cookies csrf samesite

5
推荐指数
1
解决办法
540
查看次数

无法使用 ssh 密钥克隆 Gitlab 私人存储库。密钥认证不起作用

我的 .ssh 下有默认密钥对,并在https://gitlab.com/profile/keys中添加了 id_rsa.pub但仍然无法使用此密钥访问 gitlab。

ssh -vT git@gitlab.com

无法登录:

$ ssh -vT git@gitlab.com
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to gitlab.com [35.231.145.151] port 22.
debug1: Connection established.
debug1: identity file /Users/denysobukhov/.ssh/id_rsa type 0
debug1: identity file /Users/denysobukhov/.ssh/id_rsa-cert type -1
debug1: identity file /Users/denysobukhov/.ssh/id_dsa type -1
debug1: identity file /Users/denysobukhov/.ssh/id_dsa-cert type -1
debug1: identity file /Users/denysobukhov/.ssh/id_ecdsa type -1
debug1: identity file /Users/denysobukhov/.ssh/id_ecdsa-cert type -1
debug1: identity file …
Run Code Online (Sandbox Code Playgroud)

git ssh ssh-keys gitlab

4
推荐指数
1
解决办法
2734
查看次数

标签 统计

centos ×1

centos6 ×1

cookies ×1

csrf ×1

git ×1

gitlab ×1

php ×1

samesite ×1

ssh ×1

ssh-keys ×1

timezone ×1