Last post May 08, 2012 12:01 AM by asplearning
May 03, 2012 06:23 AM|asplearning|LINK
Hello everyone, I have just created a database to store session using this link:
I am still experimenting this approach. But I have a few questions:
1. In the database aspnetState, there are two tables: aspStateTempapplications and aspstateTempSessions. What are the purposes of these two tables?
2. Now everytime a user log on to my site, I created a session variable called ClientID. Where is this session variable stored? The reason I went for SQL server to store session variable is because I do not want use the server memory. But I could not find
session variable ClientID in the two tables mentioned above.
3. Related to question 2, I created quite a few session variables in my web application. After using them, I normally clean them up by using session.remove("VariableName"). Does this still work in SQLServer mode?
4. Finally, I saw this quote:
SQLServer Mode Allows to store only serializable types (http://www.codeproject.com/Articles/31994/Beginners-Introduction-to-State-Management-Techniq#application_state)
What does it mean in simple words?
Thank you very much.
May 03, 2012 09:08 AM|asplearning|LINK
May 03, 2012 11:14 PM|asplearning|LINK
I am sorry. But anybody could share some thoughts on this please? Please tell me if I posted in the wrong forum.
Thanks in advanced.
May 07, 2012 11:13 AM|Richey|LINK
The ASPStateTempApplications table have the mapping of self-made application id and the information of web virtual directory. The ASPStateTempSessions table is to store the session data. The key field of ASPStateTempSessions table is SessionId and it is
a 32 bytes string. If you use Session.Remove() method the session will be removed from the session-state collection. When you store the data in session with SQL Server session state mode the data will be encrypted.
May 08, 2012 12:01 AM|asplearning|LINK
Richey, thanks a lot for the reply. I have been waiting for some thoughts from others on this forum. Your answer cleared a lot of my doubt and assumption. So please let me clarify if i understand what you said correctly.
When you store the data in session with SQL Server session state mode the data will be encrypted.
Based on the above quote, it means, for example, I created Session("ClientID"), so the value of the session is ecrypted in the AspStateTempSession table, is it correct? Is it encrypted in the SessionItemShort column?
The reason that I tried to understand this is because I have read a post by one member (http://forums.asp.net/t/1794432.aspx/2/10?Need+your+advice+on+passing+values+between+pages+)
saying that storing the session variable in SQL server will preserve the value even after session time out. But it doesn't preserve it in my case. After the time out, that expired session row is deleted from the table.
Is there a way I can preserve the session variables that I want to keep after session time out?