This is a limitation to iFrames.
Regardless of the fact that the page is being served in an iframe on domain A, the session cookie that is created when you login is for domain B.
The iFrame cannot see the session cookie for domain B though, it can only see the session cookie for the page that is hosting the iFirame.