Capture Session_User in T-SQL

  • HI,

    Any ideas on capturing the browser sessionid (cookie) in T_SQL?

    We are running an application developed using .Net and SQL Server 2000. We would like to record the userid for audit purpose and need help to track it in T-SQL - SP & Triggers.

    Currently the users need not have any authentication - Windows or SQL Server. Front end application takes care of the validity of the userid and password.

    Rao

    chtvrao@valona.com

     

     

     

  • Not sure what that would get you, but I think some sort of varbinary or perhaps varchar would store it. You should be able to access it in a session var and send it to the db.

  • Keep in mind that the ASP Session ID isn't a unique value.  When the web server gets restarted, the session IDs reset.  Using this val for auditing purposes probably isn't the swiftest idea.  There are other ASP server variables that might be a better idea, like IP addresses, remote addresses (unless you're using anonymous access to the web server), etc.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply