0
我正在使用警衛進行用戶驗證,登錄由html fetch api處理。Guard創建會話異步
如果登錄成功,我得到js auth to api的令牌,但我想在頁面更新用戶登錄後,但它不是。
作爲迴應,我看到爲PHPSESSID和REMEMBERME設置cookie,但它看起來像這個cookie不會持久。
我不確定,哪裏可以成爲問題,看起來像守衛讓他的工作很好。
請求不是跨域的。
請求報頭:
GET /login/check-facebook?code=xxx HTTP/1.1
Pragma: no-cache
Cache-Control: no-cache
accept: application/json
content-type: application/json
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36
x-api-token: anon.
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en,cs;q=0.8,en-US;q=0.6
DNT: 1
響應頭:
HTTP/1.1 200 OK
Server: nginx/1.8.0
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.6.16
Set-Cookie: PHPSESSID=xxx; path=/; HttpOnly
Cache-Control: no-cache
X-Debug-Token: edb1db
X-Debug-Token-Link: /_profiler/edb1db
Date: Tue, 12 Jan 2016 15:12:32 GMT
Set-Cookie: REMEMBERME=xxx; expires=Tue, 19-Jan-2016 15:12:32 GMT; Max-Age=604800; path=/; httponly
防火牆:
main:
provider: db_provider
stateless: false
remember_me:
secret: "%secret%"
lifetime: 604800 # 1 week in seconds
path: /
always_remember_me: true
pattern: ^/
anonymous: ~
logout: ~
guard:
authenticators:
- authenticator.facebook
- authenticator.email
entry_point: authenticator.facebook
這不是「堅持cookie」,而是將其發回。 – zerkms