久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

從 ssl 移動到非 ssl 時(shí)會話未保存

Session not saving when moving from ssl to non-ssl(從 ssl 移動到非 ssl 時(shí)會話未保存)
本文介紹了從 ssl 移動到非 ssl 時(shí)會話未保存的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我有一個(gè)登錄屏幕,我強(qiáng)制將其設(shè)為 ssl,如下所示:https://www.foobar.com/login然后在他們登錄后,他們被移動到主頁:https://www.foobar.com/dashbaord

I have a login screen that I force to be ssl, so like this: https://www.foobar.com/login then after they login, they get moved to the homepage: https://www.foobar.com/dashbaord

但是,我想在登錄后將人們從 SSL 中移除(以節(jié)省 CPU),因此在檢查他們實(shí)際上已登錄 https://www.foobar.com/dashbaord 我把它們移到http://www.foobar.com/dashbaord

However, I want to move people off of SSL once logged in (to save CPU), so just after checking that they are in fact logged in on https://www.foobar.com/dashbaord I move them to http://www.foobar.com/dashbaord

這似乎總是會清除會話變量,因?yàn)楫?dāng)頁面再次運(yùn)行時(shí),它確認(rèn)它們已登錄(就像所有頁面一樣)并且會話似乎不存在,因此它將它們移動到登錄屏幕.

Well this always seems to wipe out the session variables, because when the page runs again, it confirms they are logged in (as all pages do) and session appears not to exist, so it moves them to the login screen.

奇怪/發(fā)現(xiàn):

  1. 列表項(xiàng)
  2. 第二次登錄總是有效,并且很高興讓我訪問 http://www.foobar.com/dashbaord
  3. 第一次登錄成功創(chuàng)建了一個(gè)cookie
  4. 如果我登錄兩次,然后注銷,然后再次登錄,我不需要兩次登錄(我似乎已經(jīng)將其追溯到 cookie 存在的事實(shí)).如果我刪除 cookie,我將返回兩次登錄.
  5. 第二次登錄后,我可以從非 ssl 從 ssl 移動,會話仍然存在.
  6. 在第一次登錄時(shí),移動到非 ssl 站點(diǎn)會完全清除會話,手動返回 ssl 站點(diǎn)仍然迫使我再次登錄.
  7. 第二次登錄使用與第一次完全相同的機(jī)制,通過 ssl

我嘗試了什么:

  1. 使用 Cake 的 security.level 和 session.checkagent 設(shè)置 - 什么都沒有
  2. 讓 cake 將會話存儲在 db(而不是文件系統(tǒng))中 - 什么都沒有
  3. 在 XP 機(jī)器上測試 FF、IE、Chrome.

所以我覺得這與正在創(chuàng)建但未被讀取的cookie有關(guān).

So I feel like this is something related to the cookie being created but not being read.

環(huán)境:1. Debian2. 阿帕奇 23. mysql 44. PHP 55. CakePHP6.會話被PHP默認(rèn)保存為文件

Environment: 1. Debian 2. Apache 2 3. Mysql 4 4. PHP 5 5. CakePHP 6. Sessions are being saved PHP default, as files

推薦答案

我想通了.Cake 在 SSL 連接下自動切換 session.cookie_secure ini 值,因此創(chuàng)建的 cookie 是安全 cookie,第二個(gè)頁面無法識別.

I figured this out. Cake was switching the session.cookie_secure ini value on-the-fly while under SSL connections automatically, So the cookie being created was a secure cookie, which the second page wouldn't recognize.

解決辦法,注釋掉/cake/lib/session.php第420行ish:

Solution, comment out /cake/lib/session.php line 420 ish:

ini_set('session.cookie_secure', 1);

ini_set('session.cookie_secure', 1);

(只需搜索即可找到它,因?yàn)槲掖_定 # 行會隨著版本的發(fā)布而更改.)

(Just search for that to find it, as I'm sure the line # will change as releases come out.)

這篇關(guān)于從 ssl 移動到非 ssl 時(shí)會話未保存的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Session is lost after an OAuth redirect(OAuth 重定向后會話丟失)
Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分頁排序)
CakePHP Shared core for multiple apps(CakePHP 多個(gè)應(yīng)用程序的共享核心)
Login [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登錄 [ Auth-identify() ] 始終為 false)
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命錯誤:允許的內(nèi)存大小為 134217728 字節(jié)已用盡(嘗試分配 87 字節(jié)))
主站蜘蛛池模板: 亚洲色图综合网 | 九九伊人sl水蜜桃色推荐 | 99精品国产一区二区三区 | 日本三级在线网站 | 欧美综合视频 | 久久久91精品国产一区二区精品 | 一区二区在线看 | 久久毛片 | 北条麻妃国产九九九精品小说 | 国产精品爱久久久久久久 | 亚洲电影一区 | 成人av鲁丝片一区二区小说 | 国产成人精品久久 | 99久久婷婷国产综合精品电影 | 精品成人免费视频 | 99热精品在线 | 一区二区三区免费在线观看 | 波多野结衣电影一区 | 亚洲精品国产精品国自产在线 | 色综合一区二区三区 | 欧美精品一区三区 | 一级免费视频 | 免费一区 | 亚洲一区二区三区在线 | 日韩久草| 综合精品| 日韩一区二区av | 日韩免费一区 | 午夜影视网 | 在线日韩欧美 | 蜜桃av人人夜夜澡人人爽 | 国产精品区一区二 | 日韩无 | 国产一区h | 亚洲高清视频在线 | 在线观看国产视频 | 综合伊人| 午夜在线影院 | 久久久成人精品 | 在线一区观看 | 精品国产伦一区二区三区观看体验 |