title: session id in the user table in database - Should i use asp.net session id or create one through sequence
body: <p>I am designing an in house application in asp.net 4.0 and have to use the window authentication.  Database and application both are on different servers.</p>
  
  <p><strong>Environment</strong></p>
  
  <p>Asp.net 4.0, Vb.net 4.0, Oracle 10g, window server 2003 and IIS 6.0</p>
  
  <p><strong>Scenario</strong></p>
  
  <p>When user lands on the first page, system will assign a session id for this user and this id will be saved in the database in the user table under LAST_SESSION_ID column. So every time he access the application (or on new session) system will overwrite this LAST_SESSION_ID column.  I will be keeping the session id in the session variable and pass it to oracle store procedure on every DML transaction and will compare this id with the value in LAST_SESSION_ID column, if they are same then it means user’s session is still active.</p>
  
  <p><strong>Questions</strong></p>
  
  <blockquote>
    <ul>
    <li>I like to know if I should create the unique session id in the oracle database (through sequence) or use the one generated by asp.net session ‘HttpContext.Current.Session.SessionID’? To get the unique asp.net session id I would have to set the webconfig file with the following settings and I don’t know if it is a good idea as I haven’t used this technique before.</li>
    </ul>
  </blockquote>
  
  <p></p>
  
  <blockquote>
    <ul>
    <li>Is there any better solution to above scenario? For an example the system I am designing is for 200-300 users (Timesheet APP) and this is an in house application so security is not a big concern. Instead of authenticating the session in the store procedure can’t I just check the session before user send the request to database server?</li>
    </ul>
  </blockquote>