Session state

Results 1 to 6 of 6

Thread: Session state

  1. #1
    Join Date
    Dec 1969

    Default Session state

    Hi guys,<BR><BR>Am an ASP.Net beginner. I have read that the session state can be maintained in SQL server. In classic asp we can store dictonary object, recordset object in session variable. Now that that ASP.Net allows to maintain session state in SQL server, can we still store objects in session variable? if yes then how does it get stored in SQL Server? What is the logic behind?<BR><BR>Would appreciate if someone can explain me in detail.<BR><BR>Thanks,<BR><BR>Hari

  2. #2
    Join Date
    Dec 1969

    Default RE: Session state

    Where did you hear you could store your session in SQL? The session is just a collection of name, value pairs so you could store them in SQL if you wrote a bunch of code to do it but you would still have to persists something in the session for the user to know which SQL record to access.

  3. #3

    Default Wake Up : Session state

    Take a closer look at your web.config <BR><BR> &#060;!-- SESSION STATE SETTINGS<BR> By default ASP .NET uses cookies to identify which requests belong to a particular session. <BR> If cookies are not available, a session can be tracked by adding a session identifier to the URL. <BR> To disable cookies, set sessionState cookieless="true".<BR> --&#062;<BR> &#060;sessionState <BR> mode="InProc"<BR> stateConnectionString="tcpip="<BR> sqlConnectionString="data source=;user id=sa;password="<BR> cookieless="false" <BR> timeout="20" <BR> /&#062;<BR><BR><BR>That being said: If you are starting now, get in the habit of NOT using any session variables.<BR>

  4. #4
    Join Date
    Dec 1969

    Default What should be used instead?

    &#062;That being said: If you are starting now, get in the habit of <BR>&#062;NOT using any session variables.<BR><BR>What SHOULD you use?<BR>

  5. #5

    Default RE: What should be used instead?

    A ticket in a cookie and buisness objects.<BR><BR>(ok, maybe one session variable simplify storing the user id)<BR><BR>I don&#039;t use sessions, haven&#039;t needed them at all in<BR>I use commerce server a lot, it can generate a nice ticket.<BR><BR><BR>

  6. #6
    Join Date
    Dec 1969

    Default Re: ok, maybe one session variable.

    How do I store the user&#039;s ID in a session variable (using c# and In the old ASP is was as simple as:<BR>Session("ID") = intID

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts