我正在開發一個rails 2.3.2應用程序。 我需要爲訂單記錄保留session_id,檢索它並最終在訂單完成時刪除session_id。 它工作時,我用cookies作爲會話存儲,但它不適用於active_record存儲。 (我重新啓動了瀏覽器,因此沒有緩存問題。)Rails 2.3會話
我知道rails 2.3實現了延遲會話加載。 我讀了一些關於它的信息,但我仍然感到困惑。
有人可以澄清我如何使用session_id這種情況?
我在做什麼...
A user make an order going through several pages. There is no sign-up, neither login. So I keep session_id in the order record so that no other user can access the order. @order = Order.last :conditions => {:id => params[:id], :session_id => session[:session_id] } When the order is finished, I set nil to session_id column.
你將如何實現懶惰會話(與active_record存儲)環境中這種情況?
謝謝。
山姆
什麼「不工作」 - 而且,更重要的是,你嘗試過什麼?您是否確認session_id正在分配給數據庫行,並且它正在Cookie中維護? – Matchu 2009-06-24 00:37:10