Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 29132 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET 4.0 > what is session and cookies ...
Rajesh11may

what is session and cookies

Replies: 4 | Posted by: Rajesh11may on 3/6/2010 | Category: ASP.NET 4.0 Forums | Views: 7555 | Status: [Member]  


hi sir today i become your member
my question is that what is session management in asp.net and what are cookies i will be thankful to you please explain with example.

happy


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Puneet20884
Puneet20884  
Posted on: 3/6/2010 4:04:24 AM
Level: Bronze | Status: [Member]

These are a bit vast concepts and can't be explained on the forum still the simple overview but the links added for details :

Session : Server Side objects for saving your data for the session you are using the site, there is a time for which these objects stay in the memory and that is defined in web.config for session state section otherwise 20 mins by default.
http://support.microsoft.com/kb/307598

Cookies: Client Side objects for saving your data for the site you are using, we need to set the time expiaration for these objects by default unlimited life time they possess
http://msdn.microsoft.com/en-us/library/ms178194.aspx

Best Regards,
Puneet Sharma - Infosys
Pune, India

Rajesh11may, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Abhijit Jana
Abhijit Jana  
Posted on: 3/6/2010 4:45:59 AM
Level: Bronze | Status: [Member] [MVP]

Rajesh,

Welcome To DotNetFunda !

Regarding your question, As Punnet said that, these are the very Vast concept I am also agree on that.

As HTTP Is stateless, we need to maintain the state of web information either on client or server side. Session is and Server side State Management and Cookies is the Client Site Side State Management.

I am giving you few reference for Session and Cookies Article, Hope that will be very helpful to you.

http://www.codeproject.com/KB/aspnet/ExploringSession.aspx
and
http://www.codeproject.com/KB/aspnet/Beginners_Cookies.aspx

Please read those article, if you need any more help please let me know.

Thanks !
Abhijit


Cheers !
Abhijit

Rajesh11may, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Abhi174
Abhi174  
Posted on: 3/8/2010 7:27:12 AM
Level: Starter | Status: [Member]

Session is stored in the Memory i.e RAM and once you have create a session you can acess the session through out the application if the session isn't killed where as cookies stored at client machine.Client can delete that file easily.

Rajesh11may, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Sagarp
Sagarp  
Posted on: 3/10/2010 9:19:02 AM
Level: Bronze | Status: [Member]

cookies are only simple text that is stored on the client with some useful data to identify subsequent requests from the client and help the server to serve the client efficiently. cookies can hold data like books bought during an http session until the session expires. if you could store the nature of these books (e.g. fiction, technology etc.) then this data could be used to know the browsing behaviour of the user.
EX.c# CODE
HttpCookie cookie = Request.Cookies["Preferences"];


Sessions are objects (not text files) that store data and regarding a particular session and help the servlets to transfer this data to other servlet invocation so that the WEB SERVER understands (or is made to understand) that these requests have come from the same client. e.g. HttpSession objects are used to store such information.

ex. Session["UserName"] = txtUser.Text;


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Rajesh11may, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/18/2013 3:53:52 AM