Session Variable Woes - The Answer!

April 25, 2003 by JEREMY thomas

If you are wanting to immediately and automatically login the user after registration then sure create a sesison variable of the USR_ID and away you go.  You can now query the database using the USRID whenever you need info for that user.

From what you have said you are only requiring to pass some of the registration details to the subsequent page.  If this is the case then simply extract the USR_ID of the record you have just inserted [@@IDENTITY for SQL Server;  last_insert_ID() for MySQL; or you can use the recordset method object using .asp (just search in google for the keywords I have mentioned to find a good tutorial on retrieving the last inser ID)].  Having extracted the USR_ID of the record youo have added pass that to the thankyou page via a QueryString.  On the thankyou page requery the database to get the username, email etc.

Have fun.