Unlock screenOrientation to discover current orientation

After Unlocking a phone in Landscape mode, my iOS device does not automatically detect that the phone is in Landscape mode instead reverts to the previous registered mode.

For Example: I have two pages. In one page I unlock the screen orientation and in other page, I lock it in portrait mode. I go to landscape in the unlocked page and come to the other page. The page is locked into portrait mode. Now I change the device to portrait mode in the locked page and open the unlocked page. I expect the page to autodetect that it is in portrait and shift to it. But instead, the unlocked page is opened in landscape mode which is the previous registered mode. Please help.