Site Wide Login

i have installed bbpress in the root directory itself! now the problem is i want a user to login from a different page say index2.php and before getting redirected to the forum’s mainpage i.e index.php he should be redirected to index3.php. All the 3 index pages are in the root directory itself.

Basically i need a login box on the mainpage of the website and then after being logged in the user should be redirected to the backend of the website! Not the forum mainpage. The forums have been installed in the root directory so as to overcome the problem of bbpress not being able to share cookies over sub directories apart from wordpress! I use the database of the bbpress itself still haven’t got any success!