How to increase the session expiration time in Subsonic

Here's how you can increase the length of a session in Subsonic from the default of 30 minutes to something longer. In this example I'm increasing it to 2 weeks (20160 minutes).

mkdir workspace
cd workspace
sudo cp /usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar /usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar.orig
unzip /usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar
cat > webdefault.patch <<End-of-message
--- org/mortbay/jetty/webapp/webdefault.xml.orig  2014-06-11 10:06:12.000000000 -0700
+++ org/mortbay/jetty/webapp/webdefault.xml 2014-06-11 10:06:39.000000000 -0700
@@ -323,7 +323,7 @@

   <!-- ==================================================================== -->
   <session-config>
-    <session-timeout>30</session-timeout>
+    <session-timeout>20160</session-timeout>
   </session-config>

   <!-- ==================================================================== -->
End-of-message
patch -p0 webdefault.patch && rm webdefault.patch
sudo service subsonic stop
sudo zip -r /usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar ./
sudo service subsonic start

Leave a Reply

Your email address will not be published. Required fields are marked *