Forum: Ruby on Rails Rendering a View Creates Session

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bc31a158e7538cb3efb7b73ca4404fbc?d=identicon&s=25 Randall (Guest)
on 2009-06-09 02:25
(Received via mailing list)
I have a controller action that I am disabling via: "session :off"

I am noticing that a session is created when this action's view is
rendered.  Specifically, a session is created when this line in my
view code is executed:

<%= image_tag @image_path %>

Taking out this line leads to no session being created as desired.

Any ideas how to fix this?

Thanks in advanced
Bc31a158e7538cb3efb7b73ca4404fbc?d=identicon&s=25 Randall (Guest)
on 2009-06-09 07:02
(Received via mailing list)
I should clarify that sessions for that particular action is disabled
via "session :off, :only => 'no_session_action'"

When I disable sessions globally by putting "session :off" in
application.rb, no session is created when the client browser loads
the view rendered by no_session_action.

Also, sessions get created for nonsense urls that lead to the 404
page, which is something I do not want to happen.

So it appears what I need to do is detect calls that the server does
not respond to (nonsense urls, browser loading images) and not create
sessions for these calls.

If anybody knows how I can do this, I would really appreciate the
help.

Thanks!
This topic is locked and can not be replied to.