1

I've run into a safari 6 issue where it blocks third party iframe cookies unless the user has visited the domain outside of the iframe. The only fix seems to be this one here: Safari 3rd party cookie iframe trick no longer working?

But this involves some ugly workarounds (popping open a new browser window and closing again). The preferred solution I would like to take is to encrypt the session id and and append it to all routes as a query parameter. I could then use a before filter to retrieve the session by decrypting the id and loading it from the session store.

So what I can't figure out is if there's a way of appending a query param to all routes without having to edit each link directly? i.e. by adding something to my routes file.

Community
  • 1
  • 1
KJF
  • 2,083
  • 4
  • 21
  • 38
  • You can override the `link_to` helper method to add the parameters to all the Urls. The bolg post below describes it with an example: http://opensoul.org/blog/archives/2006/08/04/tip-overriding-link_to-to-accept-a-block/ – amit_saxena Oct 10 '12 at 11:57

1 Answers1

3

Override the default url options.

You can do so for your entire application in the application_controller:

def default_url_options(options = {})
  options.merge({ :session_id => request.session_options[:id] })
end
vise
  • 12,713
  • 11
  • 52
  • 64