0
votes

I have a rails 4.2.0 app running and my flash alerts are not showing up on my review server but it works just fine in development and production. I setup these couple of test actions in a controller in all three environments and the only one that doesn't work is review:

  def test
    flash[:notice] = 'test alert'
    redirect_to test1_path
  end

  def test1
    flash[:notice] ||= 'This is hard coded alert'
    render text: flash[:notice]
  end

Visiting /test on development and production redirects to /test1 and display test alert. In my review environment, redirect happens but shows This is hard coded alert.

Can there be any server config that would prevent flash alerts from showing up? Any clue about what this might be related to is very appreciated.

1
flash notices use the session to pass from request to request. Check if that server handles the session any differently in config/application.rb or config/environments/review.rb. The default Rails session store is cookies, but maybe this server is configured to use something else?Unixmonkey
Thanks for the pointer. It is configured to use cookies. However, your comment pointed me in the right direction. My review and prod were configured with the same session store secret, which I think was partially a problem. I updated secret, ran rake tmp:sessions:clear on the server, cleared browser cookies and it's back to normal. Thanks Unixmonkey! If you want to put it in an answer, I will happily accept it!Alex Terletskiy

1 Answers

1
votes

Flash notices use the session to pass from request to request.

Check if that server handles the session any differently in config/application.rb or config/environments/review.rb.

The default Rails session store is cookies, but maybe this server is configured to use something else?