I have a classic asp web app using data from SQL Server. Now the customer wants to filter the employee records based on the location of the logged in user. I could go to every page and filter the records by the session variable I have to identify the user, but I don't want to do that. I want to make one query over in my SQL server database that will filter the records and then I can just automatically feed that to every page.
How do I do this? How do I capture a session variable from my web app to use in my SQL query? I just want a way to filter my records without having to edit every page of my application, but I don't know how to tell SQL which user is using the program. The SUSER_SNAME just returns the SQL login name and that's not what I need. I need the value I have stored in a session variable. Is this possible?