You can do this without a session or cookie, but with pure javascript. Make your iframe id.
<iframe id='iframePassword' src='password.php'></iframe>
You can capture username with this
var username = document.getElementById('username').value;
You can access the password field inside the iframe with this.
var ifr = document.getElementById('iframePassword'); var password = ifr.contentWindow.document.getElementById('passwprd').value;
Now make an ajax call using username and password .
source share