"Field not Found: _SessionDataQueue" Error on NetTalk 12.39

Tags: #<Tag:0x00007f2250235f40>

As the title suggests, I’m getting the error: Field not Found: _SessionDataQueue when compiling our web application using NetTalk 12.39. @Bruce, what changes do we have to do in the code shown below without affecting the function concerning access to WebServer’s Session Data Queue.

Prior to this, the said application was built using NetTalk 11.52. I’ve already read the document pertaining the migration from NetTalk 11 to 12 and I couldn’t find anything regarding the _SessionDataQueue used by the WebServer.

Thanks in advance.

Hi Warp,

so, in NetTalk 12, the session data was moved from a “queue” to an “interface”. This disconnects the server from the session data storage, which then opens the door for other storage options. (Gordon and Flint did a session on this at CIDC 2019 as they are using a session data store which spans servers.)

What this means is that direct access to the Session store is more limited. Specifically, you have access to the interface (which is all methods) but not access to the data directly. (Weeell, sort of, you could force direct access if you wanted to.)

The interface is declared in NetWebSessionsInterface.Inc .

However, and this is probably the key thing, it’s not clear from your above code what you are trying to do. It seems to me like you are trying to retrieve a value “for all sessions” - in other words ou are getting a value which is not related to any one specific session. Is that correct?

this would better be accomplished using a “Host value”. Host values are the same as session values, but they span across all sessions. They are set using SetHostValue, and retrieved with GetHostValue.

If you have something else in mind, let me know, and I can best describe how you might achieve that.

Cheers
Bruce

Thanks for the response, Bruce.
What I’m trying to do with the code I’ve shown is to determine if a certain User ID has already been logged in, hence the use of p_web.RequestData.WebServer._SessionDataQueue.Name and p_web.RequestData.WebServer._SessionDataQueue.Value.

Prior to NetTalk 12, that was accomplished using direct access to the WebServer’s SessionDataQueue.

I think if I was doing this now, I’d use a host value. Something like;
a) In SetSessionLoggedIn
p_web.SetHostValue('LoggedIn-' & user:login,p_value)

then elsewhere in your code, if you want to see if the user is in or not;
If p_web.GetHostValue('LoggedIn-' & user:login) = true
! user already logged in.
End

Cheers
Bruce

1 Like

Thanks for the input Bruce! Guess I’ll just do it this way instead of trying to get around the changes with NT12 regarding the SessionDataQueue.

Looks like I’ll also need to delete that said Host Value whenever the session ends via NotifyDeleteSession in the WebHandler procedure.

sure, he said, thoughtfully…