Forum: Ruby on Rails Flash not cleared with ActiveRecord session store

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.
Jonathan W. (Guest)
on 2006-01-14 01:22
(Received via mailing list)
Cheers,


I've stumbled over a bug with 1.0 and ActiveRecord store for session
while migrating from pstore sessions.

I created the table with `rake create_sessions_table` and set
`config.action_controller.session_store = :active_record_store` in
environment.rb.

Everything runs fine except that the flash messages will not be cleared.
I get the same message everytime on everypage I surf. E.g. if the
message is set through an `update` action I will see it from now on
forever (or until the controler sets a new one, than this one will get
displayed on every page).

When I change back to pstore (through editing environment.rb),
everything works fine again.

I confirmed this behaviour with my project on FreeBSD 6.0 and MacOSX
10.4 with MySQL 4/5.

Anybody also seeing this or not having trouble with flash and
ActiveRecord session store?

I have the login_engine installed and therefore have to display my flash
messages like this:

<% for name in [:notice, :warning, :message] %>
   <% if flash[name] %>
     <%= "<div id=\"flash\" class=\"flash\" >#{flash[name]}</div>" %>
   <% end %>
<% end %>

Jonathan
Jonathan W. (Guest)
on 2006-01-14 20:09
(Received via mailing list)
Jonathan W. wrote:
> Cheers,
>
>
> I've stumbled over a bug with 1.0 and ActiveRecord store for session
> while migrating from pstore sessions.
>

I narrowed it down to render_component calls in the layout:

<%= render_component(:controller => "region", :action => "stats")%>

I use this for my sidebar and if I comment this out, everything is fine
again.

Disabling sessions in the called controller does not help.

With pstore sessions, everything is fine, this problem exists only with
ActiveRecord store.

Jonathan
Jonathan W. (Guest)
on 2006-01-23 17:06
(Received via mailing list)
This bug is also apparent in a new project.

Just create a new rails project and insert a render_component call in
your layout. When you use ActiveRecord Session Store, the flash value
will never be cleared.


Jonathan

--
Jonathan W.
http://blog.innerewut.de
Stefan K. (Guest)
on 2006-01-24 08:37
(Received via mailing list)
Jonathan W. wrote:
> This bug is also apparent in a new project.
>
> Just create a new rails project and insert a render_component call in
> your layout. When you use ActiveRecord Session Store, the flash value
> will never be cleared.
>
>
> Jonathan
>
I think this problem will be fixed with this patch:
http://dev.rubyonrails.org/ticket/3527

-- stefan

--
For rails performance tuning, see: http://railsexpress.de/blog
Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
Jonathan W. (Guest)
on 2006-01-24 10:53
(Received via mailing list)
Stefan K. wrote:
> I think this problem will be fixed with this patch:
> http://dev.rubyonrails.org/ticket/3527
>

Yes this fixes the problem! It also should close
http://dev.rubyonrails.org/ticket/3194

> -- stefan
>

Jonathan
This topic is locked and can not be replied to.