=>I am using one custom page as custom-router in magento2 to redirect between 3 pages "Page1,page2,page3" according to value of $currentPage variable, saved in session.
=>These three pages has two buttons to change the current page and it will change value of $currentPage variable.
if user is on page2 and ofcourse value of $currentPage is page2. And user tries to open page3 in newtab(browser). The custom router is redirecting user to page2.
- This routing method is wrong on magento2? If yes then what should be correct approach?
Can we use magento urlrewrite functionality in this case? If yes then how can we check the $currentPage variable value?
It's affecting the page loading time of the pages. How can we avoid that?