Best approach to pass parameters between pages
Hello,
Frequently, we have to pass parameters between pages. As I started working with AEM (6.1 Sites) recently, I have some questions regarding the best approach to follow:
- Using query parameters: I think this is the easiest way to pass parameters. However, the page will not be cached and it could be a problem if the page is "heavy".
- Using cookies: The cost of implementation is low, but if the user disables his cookies, the parameters will be lost.
- Using Sling Selectors: The page will be cached but in cases that we need to pass multiple parameters, it may become a little confusing.
I could list those approaches and could not decide which one I am going to follow.
Here are some examples of our scenarios:
- A input text and a button in page A. When clicking the button, the user is redirected to page B with a parameter containing the value of input text.
- A page that has 3 components that could have a custom behavior according to parameters received. Component A is affected by parameter A, Component B is affected by parameter B and Component C is affected by parameter C. None of those parameters are mandatory (component has a default behavior).
- Component that list pages using pagination (therefore, affected by pagination parameters).
Are there other approaches? Is there a best approach among all?
Thank you!