I have built an application which reacts differently given the request context, if a page is requested asynchronously, for example.
The problem is, when you submit a form asynchronously and redirect, the result cannot be detected with HTTP_X_REQUESTED_WITH. And my application needs to know if a redirect comes from after an asynchronous submission or not.
I came to the conclusion that easiest way to proceed is to mimic a xmlhttprequest request in the redirect. It avoids the use of sessions.
Is it a good idea?
If yes, how would you add headers that do what I want?