Click here to Skip to main content
15,889,879 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can some one please explain it with an example
Posted
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900