Rails 3:禁用会话Cookie [英] Rails 3: Disable session cookies

查看:164
本文介绍了Rails 3:禁用会话Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个控制器来提供动态样式表,所以我可以使用image_tag帮助程序并添加一些缓存控件。

I created a controller to serve dynamic stylesheets, so I can use the image_tag helper and add some cache control.

问题是每次css文件在浏览器中加载,我可以在firebug中看到Cookie xxx changed消息。我想禁用或绕过此控制器的会话Cookie。

The problem is that every time the css file is loaded at the browser, I can see 'Cookie xxx changed" message in firebug. I would like to disable or bypass session cookies for this controller.

session :off


谢谢!

推荐答案

只需将 session_store 设置为:disabled 像这样:

MyApp::Application.config.session_store :disabled

这将完全禁用会话以及访问 flash

That will completely disable the session as well as access to the flash.

这篇关于Rails 3:禁用会话Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆