Rails Checkout SSL heroku [英] Rails Checkout SSL heroku
问题描述
我将我的应用与heroku一起部署,并将SSL配置为我的一个子域(secure.mydomain.com)。我想只命令我的应用程序的一部分使用这个ssl,所以在我的订单控制器我有一个之前的筛选器重定向请求到我的安全子域。然而,所有会话信息在重定向时都会丢失。我认为是因为子域。我该如何重定向,以便可以检索会话信息(存储在db中的购物车信息和一些id信息)。有人可以帮忙。
KIran
在你的config / intializers / session_store.rb中将它改为
Yourapp :: Application.config.session_store:cookie_store,: key => '_yourapp_session',:domain =>:全部
设置为全部时,Cookie将存储在所有子域名和主域名中。
I have my app deployed with heroku and have a SSL configured to one of my subdomain(secure.mydomain.com). I would like only order part of my app to use this ssl so in my orders controller I have a before filter to redirect the request to my secure subdomain. However all the session information is lost when it is redirected. I think because of the subdomain. How do I redirect this so that session information (cart info which is stored in db and some id information) can be retrieved. Can some one help please.
THanks KIran
In your config/intializers/session_store.rb change it to
Yourapp::Application.config.session_store :cookie_store, :key => '_yourapp_session', :domain=>:all
The secret-sauce is the domain... When set to all, cookies will be stored across all subdomains and the main domain.
这篇关于Rails Checkout SSL heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!