In Construct 2 you can add an AJAX object to your project, then pass requests back and forth to PHP - to login, query a mysql database, etc.
There are several tutorials that helped me get started - and it really isn't very hard if you already know PHP.
So, it could be easily done either way. If you are doing it out side of Construct 2, then just set session variables when you process the form. Then once inside Construct 2 use AJAX to call a PHP file that will pass in what you need.
If you want the entire thing to be self contained, then it can be all done within Construct 2 (and use AJAX to call PHP files to save or load anything you want stored in a database).