login user after form submit
You could use something like auto_login_url and generate a url then redirect the user to that URL before you go to the node. This is mainly an API module that allows you to generate URL login links so you will have to code the solution. There are a couple of other URL login modules out there but this one has a pretty easy API to handle with no large learning curve.
From the module page:

Creates auto login URLs on demand and through tokens.
This is mostly a developer's module. The better use for me is to convert all links of a specific text to auto login links.

Similar module urllogin