Hi everybody,
I need to pass a secure key around in a session variable and i'm having trouble finding a manual that gives me a clear idea as to what is happening with, and how to use sha1().
When the user logs in their static key is retrieved from the db and then this key is passed around in the session and is used in every query that the user makes on the db. Like so.
[CODE=mysql]SELECT * FROM table WHERE 'name' = 'joe' AND 'key' = sha1(numerickey );[/CODE]
I guess i just don't understand how sha1() works. Can anyone help explain it to me? or.. give me a better idea as to how to filter db results with a secure 'key' that blocks results not belonging to the user.
Thanks in advance!
I need to pass a secure key around in a session variable and i'm having trouble finding a manual that gives me a clear idea as to what is happening with, and how to use sha1().
When the user logs in their static key is retrieved from the db and then this key is passed around in the session and is used in every query that the user makes on the db. Like so.
[CODE=mysql]SELECT * FROM table WHERE 'name' = 'joe' AND 'key' = sha1(numerickey );[/CODE]
I guess i just don't understand how sha1() works. Can anyone help explain it to me? or.. give me a better idea as to how to filter db results with a secure 'key' that blocks results not belonging to the user.
Thanks in advance!
Comment