Sessiom is getting started again and again because of that user is getting logout page

Hello Team,

We just migrates our application from railo to lucee.For the new users of our application for first hit of lucee url getting logout page. This error persist in lower envirornment as well. I checked the logs and found out session is getting started in between and so that some of the session values are getting lost in between. So that some cfif condition are not getting satisfied and user is getting logged out page.

Don’t forget to tell us about your stack!

OS: Windows 8 / 11
Java Version: Java11
Tomcat Version: 8.5
Lucee Version: 5.3.10.120

Please help me out here.

What Session storage do you use? Is session management enabled?
I guess you have to trace the session between creation and the lost session values and check what is the cause.

We are using in memory session storage and yes session management is enabled. Not sure what is the cause.

I’d guess this has something to do with the code. Even if your code worked with railo… I’d try looking at the code sequences and conditionals (especially, I’d check for variable names and their scopes, you may be getting false references).

When application starts, it firts executes application.cfc and from there it goes to logonhandler.cfm. In logonhandler.cfm some session variables get set and from there it agian goes to Application.cfc and here session gets started again. Because of this previous session values get lost and logout is happening

This is almost impossible to analyze without seeing any code and viewing/debugging it in action. Without that, it’s just guessing.

I agree. Its like for almost every page change/load session is strting again and again. Not sure what setting is goin wrong

One more thing here when we hit our old railo url and then hit lucee URL it will work as expected. But if we clear cache and then hit lucee URL it will not work.

When you say clear cache

  1. which cache
  2. is this client (browser) or server?

Some version of stripped down code (smallest example of the issue) is going to be best.
Without more context, we’re throwing guesses with little to go on.
A final idea as you step through your code, take a look at the network tab in your browser.
Note any redirects (which will not set the session cookie).
Note when your cookie changes (when a new session starts) and what the prior network tab request was that led to the new cookie.

Hi Phill,

Its a client cache.
Also, for every time it is running Application.cfc new session is starting. I entered into application through logonhandler.cfm sestting some session variables and checking those variables in Application.cfc. But when I come to application.cfc by that time new session gets started and hence previous session varibles get lost and thats why get a logout page.
following things are written in application.cfc under cfscript

this.name=“lucee_context#server.lucee.version#”;
this.sessionManagement = true;
this.sessionType = “cfml”;
this.setClientCookies = true;
this.clientManagement = true;
this.sessionStorage = “memory”;
this.scriptprotect = “all”;