Force a session to be created when doing a cookie test
authorTom Hughes <tom@compton.nu>
Wed, 1 Jun 2011 09:16:11 +0000 (10:16 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 1 Jun 2011 09:16:11 +0000 (10:16 +0100)
app/controllers/application_controller.rb

index 6c19b3a529c26a4c463dcc350034280649adfb27..122349affca241f5fdfc70c6322b851a3a5ce2fa 100644 (file)
@@ -61,11 +61,14 @@ class ApplicationController < ActionController::Base
   def require_cookies
     if request.cookies["_osm_session"].to_s == ""
       if params[:cookie_test].nil?
+        session[:cookie_test] = true
         redirect_to params.merge(:cookie_test => "true")
         return false
       else
         flash.now[:warning] = t 'application.require_cookies.cookies_needed'
       end
+    else
+      session.delete(:cookie_test)
     end
   end