Login after register
Posted: Sat Jan 31, 2009 10:01 pm
I am wondering how I can accomplish logging in a user immediately after registration.
Current process goes
Login -> login.php which creates a session object and uses header to redirect the user to /index.php
Register -> register.php which adds the new row to the db and uses header to redirect the user to /index.php
I would like to be able to have it go from register, if the row is added successfully, redirect to login using post (their login info), which will redirect them to /index.php
The only thing I could think of was sending an unsecure request using header header('Location: login.php?username=uname&password=pw').. from the register.php script, but that seems risky...
any ideas?
Current process goes
Login -> login.php which creates a session object and uses header to redirect the user to /index.php
Register -> register.php which adds the new row to the db and uses header to redirect the user to /index.php
I would like to be able to have it go from register, if the row is added successfully, redirect to login using post (their login info), which will redirect them to /index.php
The only thing I could think of was sending an unsecure request using header header('Location: login.php?username=uname&password=pw').. from the register.php script, but that seems risky...
any ideas?