I am passing a parameter to a VF page from a controller. This works in Classic but not in Lightning. I have printed all the ApexPages.currentPage().getParameters(); to see all the parameters and it is clearly not seen in the Debug logs for Lightning as it is not propagated by the system. I am passing parameters between 2 controllers.
Passing from the First Controller:
new PageReference('url').getParameters().put('rmsg', 'Object created successfully');
on the 2nd controller:
ApexPages.currentPage().getParameters().get('rmsg'); - This is null only in Lightning
Any ideas on how to fix it?