Hello,
We are using GitHub - lucee/extension-memcached extension for session. memcache server we using AWS server.
We having issue of session time out in 10 minutes and its not using the session timeout values set in application cfc.
I updated the latest snapshot and updated setting in application cfc as below
this.ApplicationTimeout=CreateTimeSpan(1,0,0,0);
this.SessionTimeout=CreateTimeSpan(0,1,0,0);
this.sessionStorage = “memcache”;
this.SessionManagement=true;
this.setClientCookies = true;
this.setDomainCookies = false;
this.cache.connections[“memcache”] = {
class: ‘org.lucee.extension.cache.mc.MemcachedCache’
, bundleName: ‘memcached.extension’
, bundleVersion: ‘4.0.0.7-SNAPSHOT’
, storage: true
, custom: {
“log”:“”,
“default_expires”:“3600”,
“protocol”:“Binary”,
“compress”:“true”,
“failure_mode”:“Redistribute”,
“servers”:“xxxxxmemcached.xxxxxxxx.amazonaws.com:11211 ”
}
, default: ‘’
};
OS : centos-release-7-6.1810.2.el7.centos.x86_64
Java Version : 11.0.3 (AdoptOpenJDK) 64bit
Tomcat Version : Apache Tomcat/9.0.41
Lucee Version : Lucee 5.3.6.61
Any help or guidance will be great.
Thank you,
there’s a newish timeout option?
committed 05:43PM - 26 Aug 20 UTC
Hello @Zackster thanks for reply, Do you mean by the setting option default_expires ?
Yes if you notice in my settings codebase, I have set it to 1 hour as “default_expires”:“3600”,
Not sure why its not picking up,
Please let me know if I missed anything else you wanted to pointed out.
there’s a new timeout
option
this.cacheName = cacheName;
this.arguments = arguments;
{
CFMLEngine engine = CFMLEngineFactory.getInstance();
Cast cast = engine.getCastUtil();
// maxSize (maximal size before objects get Compressed)
boolean gzip = cast.toBooleanValue(arguments.get("compress", null), false);
long maxSize = cast.toLongValue(arguments.get("maxsize", null), ONE_MB);
timeout = cast.toLongValue(arguments.get("timeout", null),
DefaultConnectionFactory.DEFAULT_OPERATION_TIMEOUT);
// log
String strLog = cast.toString(arguments.get("log", null), null);
if (!Util.isEmpty(strLog, true)) {
this.log = config.getLog(strLog.trim());
}
TranscoderImpl _transcoder = new TranscoderImpl(config.getClassLoader(), gzip, maxSize, log);
// host(s)/port(s)
OK thanks, I will try this parameter in my application cfc. BTW this parameter setup wasn’t provided in Lucee admin to setup, and identically it should use the sessiontimeout setting from application cfc. Your Thoughts ?
i think timeout just needs to be added as field below
<!---
*
* Copyright (c) 2015, Lucee Association Switzerland. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
---><cfcomponent extends="Cache">
<cfset fields=array(
This file has been truncated. show original
I would set the memcached timeout slightly longer than the lucee session,
ie 2-3 mins (the inactivity timeout for a session before it gets saved to memcached)
better a stale session in memcached than a session scope disappearing