I want to add a persistent query string to pages once it is introduced (for the context module to maintain a page layout inside an iframe). At the moment, I'm checking the http referer for the string and redirecting to the current url + query string.
This works fine, except:
- It's an extra page load. Not a big issue as it's an admin page inside an iframe that's not used much.
- It breaks batch pages. I think I can get around this by checking if arg(0) is "batch" and then add the referer to $_session and then check for it.
This seems really convoluted, hacky and prone to breaking the site for a user if I don't get the session variable deleted straight away.
hook_url_outbound_alter() doesn't work for forms unfortunately so is there a better way?