Web Connection
Weird session behavior
Gravatar is a globally recognized avatar based on your email address. Weird session behavior
  Keith Hackett
  All
  May 3, 2017 @ 12:35pm

I have a real head-scratcher of a problem. I have a client website that's been running under WC 4.68 for several years (if it ain't broke, don't upgrade it;) ). In the last couple of months, we've had a really weird sporadic issue arise where a user will access a page and the session returned is another user's session. It appears to be app instance-specific. Unloading the COM servers and reloading them will make the problem go away. Sometimes the problem will go away for hours, other times for weeks.

I've noticed that when the problem occurs, there will be "extra" COM servers running than is configured. There should be 3 but usually I find 5 or so running. And, these extra servers usually seem to be consuming a lot of processor time which is unusual. I'm assuming the servers are hung-up and the system restarted new servers. I have to end-task them.

I've performed system maintenance on all of the data tables (including wwsession) by packing and reindexing.

Anyone have any idea/suggestions?

Gravatar is a globally recognized avatar based on your email address. re: Weird session behavior
  Rick Strahl
  Keith Hackett
  May 3, 2017 @ 01:47pm

Hard to say without more info. What server are you running, and can you verify whether sessions end up getting duplicated in the wwSession file? If so then most likely there's some sort of application or cookie problem. Make absolutely sure that the cookie ids created are not longer than the fields in the database.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Weird session behavior
  Keith Hackett
  Rick Strahl
  Nov 13, 2017 @ 09:53am

I think I finally have some more info on this problem.

I think I've isolated what triggers the problem. It only seems to occur when the server thinks the COM instance has timed out and hung up and so it fires off a new server instance. Once that occurs, the session is not retrieved correctly on the new server instance.

That being said, is there anything different about how a new server instance is fired off when there's a hung server versus normal COM server loading?

FWIW, I do have a modified version of the session table in use with a few custom mods made to wwsession. I've lengthened the sessionid under GenerateSessionId() to 14chars with this line: RETURN SUBSTR( SYS(2015),2,9) + PADL(TRANSFORM(_VFP.ThreadID),5,"0") I've wondered if there might be some obscure bit of code that expects a 9-char sessionid that I've somehow overlooked?

Gravatar is a globally recognized avatar based on your email address. re: Weird session behavior
  Rick Strahl
  Keith Hackett
  Nov 13, 2017 @ 11:13am

Latest version of Web Connection uses 17 charcter sessions and those are based on partial guids, so I think you're a bit behind in versions 😃

Sessions were never 9 characters unless you added some customization logic yourself and session keys are not tied to specific instances but are of course accessible for any instance accessing the table.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Weird session behavior
  Keith Hackett
  Rick Strahl
  Nov 13, 2017 @ 11:33am

You are definitely right, this site is behind in its updates. This is an old 4.68 version. However, the unmodified wwSession::CreateTable() method in the 4.68 version did create a 9-character sessionid in the session table. That's why I had originally added those custom enhancements.

Up to this point I couldn't justify the time to do an upgrade. However, maybe now is time.

But, my question still stands. Is there anything different about how a COM server loads when the system has determined that a server has crashed/timed-out versus a normal COM server load?

Gravatar is a globally recognized avatar based on your email address. re: Weird session behavior
  Keith Hackett
  Rick Strahl
  Nov 13, 2017 @ 12:33pm

Rick, I'm going to go ahead and upgrade them to the latest version. Do you have the link to the version 4->5 upgrade guide? I'm having trouble finding the link.

Gravatar is a globally recognized avatar based on your email address. re: Weird session behavior
  Rick Strahl
  Keith Hackett
  Nov 13, 2017 @ 01:43pm

We're on version 6 😃

4-5 was a pretty major upgrade. 5-6 is relatively minor.

The 4-5 and earlier upgrade guides have been removed from the docs. The older versions have help files that contain that information. IOW you have to download and unpack a 5.x version to get the docs for that.

The 5-6 upgrade notes are in respective What's New topics.

Your best bet is probably to create a new project then move your existing code into it. 99% of the code will work as is and by creating a new project you are side stepping some of the internal change issues that you would otherwise have to deal with. For the most part this should be a cut and paste operation for your process classes and setting up the main app's configuration methods.

The additional benefit is that you get the new self-contained project structure that's much easier to move and deploy.

+++ Rick ---

© 1996-2024