You have a bunch of repeated recordset includes, you can delete all but one of those.
Auto Login should work based on the code that I see. Is there a sample url where I can test it? Maybe the problem is with setting the cookies in the first place.
It doesn't auto-submit the form, it checks to see if the cookies are set and automatically logs in and redirects before the form is even created when it functions properly.