B4J Question Global Variables For Single Request

Squiffy

Active Member
Licensed User
Longtime User
When a request comes in to my server it passes through a couple of filters then to a handler.

Without using the inbuilt session handler, is it possible to have a "global" variable that would be accessible to all filters/handlers for the lifetime of that single connection/request?

I can create globals in "Main" but - unless I have misunderstood - these are application wide globals and not just specific to the connection that is rippling through the filters/handlers at this moment.

I don't want to pass the session cookie which is why I don't want to use the in built session handler, and any attempt to kill off the session before responding doesn't seem to stop it being sent.

EDIT -
to clarify, I don't want a system wide global, just global within the confines of that user's current connection scope, so only that connection can see it. If there were 100 connections then each of those would have their own version of that connection global variable.
 

Squiffy

Active Member
Licensed User
Longtime User
Actually - I suppose another way would be to use the session variables IF I can suppress B4J from sending the cookie which it seems to do automatically. I don't need the data saved from request to request, so when the connection ends the data can be destroyed.

Is that possible?
 
Upvote 0
Top