Reputation: 23
I know that a php session is stored in the tmp folder.where is the session stored in JSP? I have searched it in google but I can't find exactly what I need.
Upvotes: 0
Views: 397
Reputation: 48067
It depends. It might be in memory, or it might be written to some temporary directory or even to the database - typically this is configurable on your servlet container or application server. (You don't mention which one you're using - but even then: It's typically configurable)
If you use cluster configurations with session replication (where you can continue a session on a different server in that cluster) it needs to be persisted. Otherwise it's fine to keep the session in memory. Remember that PHP has a scripting nature - e.g. once a script is done, there's no more running process - Java has a virtual machine running all the time, waiting for future requests. Thus it's easy to keep something in memory (and just one more reason to be very careful with sticking large amounts of data into the session)
Following your comment: You'll find the defaults ("SESSIONS.ser") for Tomcat 7 and Tomcat 8 in the documentation - just look for Standard Manager Implementation and the pathname
attribute. I'm not sure you'll be able to make much use of it - it'll all be serialized java objects, there's nothing to see or do in there for you.
Upvotes: 1