Wednesday 1 May 2013

Session State Management

Session is a block of memory on server allocated separately for every user of the website and is used to store the data that is private to a particular user. For the applications like online shopping session state is required for storing items selected by the user in different pages and finally gets the list of session and prepares the bill

Session has the following advantages over Cookies
  • Session data is stored on server and then there will be security for the data. But cookies are stored on client system in plain text file and hence there is no security for the data.
  • Session can store any type of data whereas a cookie can store only standard type of data like int,float,double,string,date.
  • Session has no limit and you can store any type of data in the session whereas a cookie can store a maximum of only 4KB data and overall 80KB if the browser allows a maximum of 20 cookies per website.
  • Session state cant be disabled by an end user and hence the code within using session will work whereas cookies can b disables with end user in browser and hence there is no guarantee that your code that uses cookies will work.