Click here to Skip to main content
13,050,617 members (79,103 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Can some one please explain it with an example
Posted 4-Jun-13 20:57pm
Shubhashish_Mandal 5-Jun-13 3:33am
Session use key-value pair to store data. You can store object in session and can retrieve it and can modify it against the key. But keep in mind , try to avoid to use session to store huge data.
Shruthi GM 5-Jun-13 5:54am
Thanks Shubhashish. Can u please give me an example for this. I just want to store user information like(name, age, Dob, etc)in session and display it on jsp and again update the informations in same session
Shubhashish_Mandal 5-Jun-13 7:12am
its very easy and I believe you can do this. Instead of putting all the information(name, age dob) separately in session, create an instance of type "User"(with name, age, dob properties) and set it in the session with a key.
To modify it simply retrieve it from session , then modify it and again set it in the session with the same key.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 5 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100