Session values take the place of variables extensively, but unlike variables the compiler will cheerfully accept any typo'd or missing session value. You can go quite a while without noticing the problem.
For those situations where the session value must be present, I use a new method, GSV2, that simply calls GSV for the session value and ASSERTS that the returned string is not empty before returning the session value. If it is empty, the ASSERT message identifies the called session value as missing. Since ASSERT only fires in debug mode, it never interupts server operation in release mode.
I add this method to the base class because of the complexity of adding the method to a derived base class. The protype is:
GSV2 PROCEDURE(String p_Name),STRING,VIRTUAL
The method code is:
NetWebServerWorker.GSV2 PROCEDURE(STRING p_Name)
GSV2String STRING(256)
CODE
GSV2String = self.GSV(p_Name)
ASSERT(CLIP(GSV2String) ~= '','Session Value empty: '&CLIP(p_Name))
RETURN CLIP(GSV2String)
While I don't like making changes to the base class, at least the compiler will let you know if you have updated the base class without adding the this method.
This method has saved me a lot of time, so I am passing it along. If there is a problem with it, please post your concerns.