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.
6805b35d0a8ea3ede0a7da2d4cf5ae77?d=identicon&s=25 Jonathan Weiss (Guest)
on 2006-01-14 00: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
6805b35d0a8ea3ede0a7da2d4cf5ae77?d=identicon&s=25 Jonathan Weiss (Guest)
on 2006-01-14 19:09
(Received via mailing list)
Jonathan Weiss 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
6805b35d0a8ea3ede0a7da2d4cf5ae77?d=identicon&s=25 Jonathan Weiss (Guest)
on 2006-01-23 16: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 Weiss
http://blog.innerewut.de
E555e7c34196967444a47a96395a23ab?d=identicon&s=25 Stefan Kaes (Guest)
on 2006-01-24 07:37
(Received via mailing list)
Jonathan Weiss 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
6805b35d0a8ea3ede0a7da2d4cf5ae77?d=identicon&s=25 Jonathan Weiss (Guest)
on 2006-01-24 09:53
(Received via mailing list)
Stefan Kaes 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.