Questions on Session Information in Spring MVC Application ?

1. How session will be stored in the server in spring mvc application ?

2. What are the different ways to store session in spring mvc application ?

3. Which approach would be efficient (client side or server side) ?

4. How to list all the sessions created in the server ?

5. How to invalidate a particular session which is active in the server - session id is available ?
Software ProgrammerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mccarlIT Business Systems Analyst / Software DeveloperCommented:
1, 2, 3.  Sessions are managed by the servlet container not by Spring so it depends on what you are using.
4, 5.   In a general sense, the only visibility of sessions that you have is via events received with a HttpSessionListener. You would have to track the sessions as they are created/destroyed and you can then use HttpSession.invalidate()
Ayomide AkinrotoyeCommented:
1. Session is stored on the server
2. In spring mvc application, depending on the kind of configuration you are using, You can use the @SessionAttribute annotation of spring or set the session attribute using Spring's HttpSession.setAttribute() method
3. Depending on the kind of application you are developing. It is usually smarter to use server side session management
4. As previiously stated, you can use HttpSessionListener of spring
5. To invalidate a session, you use the HttpSesssion.invalidate() method
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Software ProgrammerAuthor Commented:
i went through the code however we retrieve only one session in the code. i want to retrieve all the session. am i missing anything?
however we retrieve only one session in the code. i want to retrieve all the session.
I don't understand what you saying here. All the active sessions were held in the Hashtable. The test JSP, in my code, demonstrates how to access them.  
Please tell us what exactly you are trying to accomplish?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Software ProgrammerAuthor Commented:
Thanks a lot and now i understand..We can resolve this...No issues..It has been resolved.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.