Hi Dan,
Dan said:
I thought I would clarify more what I am looking for so here is the
deal.
I already have a Login.asp page where the user can type in login
information then I have a verify.asp page that verify's the user
login info with the username and password information in MySQL
database.
The problem is I need a unique user ID and I could just use some sort
of random user ID number generator function into MySQL as a primary
key (userID) but once the number has been generated for new user that
has been added to MySQL database that user ID is going to be the same
for as long as the user exists in the database.
I would much rather just have my verify page verify that the username
and password are correct and than have ASP assign a session ID to
that user for the duration that they are on my website that way it is
more secure and less likely that someone could guess the URL as the
session ID number would only be valid for the duration that the
proper user is logged into the site and would be a different number
the next time that same user log's into the site.
Please can anyone help with this question ?
Dan Thompson
Every ASP session generates a unique session ID, as Evertjan has pointed
out. However, for what you've said you're trying to accomplish, I doubt that
the session ID would be of use, because a unique ID is generated every time
a user logs in, and it is used only to track that specific session, so it
would have no value as a validator in a cookie.
OTOH, a unique user ID that is assigned when the user is initially added to
the database can be accessed during log in to track other activities.
Typically, this will be a key field to make searches faster, and is useful
as a way to build entries in a related table, for example for logging orders
or such. As you may guess, this leads to a host of other issues regarding
the structure of relational databases that is unrelated to the issue of
security.
There is a lot of information about this on the web, and if you narrow your
concerns a bit, a google search will provide you with a lot of reading
material.
Best,
Neil