Thursday, May 22, 2008

ListingWare Session Management

I've pretty much completed a pretty major undertaking with regard to Session Management in LW. A "Session" is the technical term for an end user's visit to your ListingWare service. Now, this post is going to get WAY geeky - read on, if you dare!

Here's the details:

WAY BACK with LW, I had made the decision that I didn't want to require that users enable cookies in order to use the system. Many sites do require it - some as big as Amazon.com and the like. I wanted the lowest common denominator to be if a user just decided to turn off ALL cookies or may have the oldest version of a browser, regardless of Internet Explorer, Firefox, Opera, Safari...whatever.

The version of ColdFusion that we started with was CF5, which was still a C+ DLL on IIS4, I think. The best that it could do then was the CFID/CFToken pairing, which by default was set to a persistent cookie, meaning it did hang around after a user's session, and was forced into the browser's cache. Not so good. I had long ago used a CF technique of making the cookie non-persistent, just for the scope of the session, but it still wasn't ideal. Part of the technique for this method was doing a test of the browser to see if it would accept cookies. If it did, one was passed for CFID/CFToken; if not, I had to code so that it was programmatically appended to every URL or Form so the session could persist.

Because it's been YEARS since I revamped for the CFID/CFToken method, everything we have access to is more modern: CF8 is now Java-based and able to take advantage of some underlying Java systems and techiques; IIS6 has memory partitioning and isolation; browsers are more secure by default - both a good and bad thing. So, it would seem, the problem we've been having with Session Management was bound to happen at some point.

With CF8, the optimal method of Session Management is to use the J2EE (Java) system. Instead of CFID/CFToken, the variable JSessionID is now introduced when needed. I've recoded the URLs and Forms to automagically include the JSessionID variable. J2EE variables are properly done for the user's session only, rather than being persistent like the old CF5 variable was. For the method I've used, a browser that accepts cookies will see:

http://www.bobhendren.com/search/index.cfm?City=Atlanta&MinPrice=100000

A browser that doesn't accept cookies will have the following format:

http://www.bobhendren.com/search/index.cfm;jsessionid=X9X9X9?City=Atlanta&MinPrice=100000 (the JSessionID is actually a much longer pseudo-random alphanumeric string)

Notice that now it has inserted a semi-colon and the JSessionID variable BEFORE the question mark. This will make sure that the session is handled first and separate from the query variables after the question mark.

I've done some pretty extensive testing so far, but I'm sure there are places that still aren't fixed, so if you find one, email us at support@listingware.com. If a page seems to be loosing its session, I may have missed the link for that page or a form variable somewhere.

I've tested in both IE, Opera and FF so far with cookies on and off. Seems to be working well!

What's Happening At ListingWare

I normally wouldn't get into this sort of thing, but I feel the need to bring our customers up to speed on what's been happening at ListingWare lately.

Some of you have been saying that you've had problems with our Support lately - you're right. We HAVE had some difficulties with keeping up. The ListingWare service has stayed up and running, but we haven't answered email and phone calls as timely as I like. I don't like to make excuses, but I will tell you that a couple of HIGHLY unusual things have occurred recently:

In February, Craig Parana, who has been our lead Customer Service and Support person for years, was diagnosed with a malignant brain tumor (you may have seen something in our Account Manager about this). He's had a rough go over the last few months, but it looks like the doctors have removed all of the tumor after a couple of operations. Now, with radiation and chemotherapy, he really hasn't been able to work at all, so that's a big hit. We continue to keep him in our thoughts.

Also, Max Hendren, COO/CFO - and my lovely wife! - had some issues starting in March. We were scared that she might have something malignant also, but it turns out that it wasn't, thank goodness. Still distracting, though. She just had her operation at the beginning of last week and is home and recovering now.

There have been a few other odds and ends - moving ListingWare to a new data center; other folks transitioning away, training new ones; short-term absences from work for a couple of people. You know how it goes...

But hey! We're still here! And we're STILL determined to keep ListingWare as a vital part of our customers' online businesses! We apologize and appreciate your continued patronage.