This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes HTTP Session variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "HTTP Session variable" Watch "HTTP Session variable" New topic
Author

HTTP Session variable

Rashmi Trivedi
Ranch Hand

Joined: Aug 13, 2001
Posts: 60
Hello All
in my JSP or servlet code, i use Http Session varaible to store user name and use id and thigs like that to verifyt the autorise users.

I was just wondering if there is any limit as to how may variale you can store in Session..Can anybody advise me?

Thanks and regards,
Rashmi Trivedi
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Rashmi Trivedi:

I was just wondering if there is any limit as to how may variale you can store in Session..Can anybody advise me?



There is no limit on the size of information that can be saved in a Session Object. just only limitation of the RAM available on the Server machine.
[ December 10, 2006: Message edited by: Saif uddin ]

Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

and see this thread for more clearing up on session
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
As the objects that you store in session live in heap , so the amount of data that you can store depends on the number of sessions and the heap size.


Rahul Bhattacharjee
LinkedIn - Blog
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Just to clear things up a bit, what Saif and Rahul said are both true, although the way the responded made it appear it might be 2 different answers. ;)

The number of objects you can store in the session is dependent on how much memory you've allocated for the VM. The amount of memory allocated to the VM is dependent on the amount of RAM on the server(s).
[ December 10, 2006: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Session variable
 
Similar Threads
Tradeoff using http session/stateless bean and stateful session bean
Store Object in HTTP Session
Maintaing everthing in Session Object
Session Object
java application accessing the ejb