Is there a way to specify a different session store with Tomcat?

Andrew Ingram :

Tomcat (version 5 here) stores session information in memory. When clustering this information is periodically broadcast to other servers in the cluster to keep things in sync. You can use a database store to make sessions persistant but this information is only written periodically as well and is only really used for failure-recovery rather than actually replacing the in-memory sessions.

If you don't want to use sticky sessions (our configuration doesn't allow it unfortunately) this raises the problem of the sessions getting out of sync.

In other languages, web frameworks tend to allow you to use a database as the primary session store. Whilst this introduces a potential scaling issue it does make session management very straightforward. I'm wondering if there's a way to get tomcat to use a database for sessions in this way (technically this would also remove the need for any clustering configuration in the tomcat server.xml).

Olaf Kock :

There definitely is a way. Though I'd strongly vote for sticky sessions - saves so much load for your servers/database (unless something fails)...

http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html has information about SessionManager configuration and setup for Tomcat. Depending on your exact requirements you might have to implement your own session manager, but this starting point should provide some help.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Any way to share session state between different applications in tomcat?

tomcat 7 store session in redis

best way to store session in codeigniter

Rails app with different session store for each model

is there a way in siddhi to store app session data?

Express-Session - Is there a way to store data in a session outside of an ExpressJS route?

Spring boot - How to specify different location for rotated tomcat log file

Is this a correct way to store different types in the same allocation?

Efficient way to store different data types

Best way for allowing subdomain session cookies using Tomcat

Is there a way to specify a different function when passed a lvalue and another when not?

Different way to specify matching new line in Python regex

Best way to store a button toggle state in a Cookie (or possibly Session Storage)?

What's the best way to store session ID in iOS?

specify shell for ssh session

Specify session cookie in RAML

In Laravel, the best way to pass different types of flash messages in the session

How to store data like jwt token in Angular 8? Is there another way to store safely using localstorage or session storage?

is there a way in R to specify all different three-way combinations in a contingency table?

Session being deleted prematurely from database when using Tomcat and PersistentManager using JDBC Store

What is the best way to store different types of data with a Promise.all?

Best way to store different values in pandas dataframe columns?

Sane way to store different data types within same column in postgres?

Best way to store Excel Rows with different columns related to each other?

Best way to store an ordered list of objects that are of different types in Java?

Best way to store the quantity of Stock of different types in sql

Good way to store in mongo a large sets of different values of a device

What's the best way to store data for different lists?

Best way to store the values from different Form - React JS