WebSpeed Session Management

Posted by Admin on 04-Dec-2009 09:37

Hello Folks,

I am quite new to WebSpeed and have come up with a software design that requires stateful environment. In my design I  have a GLOBAL TEMP-TABLE that needs to be maintained for each user session. The data is loaded into this GLOBAL TEMP-TABLE from a .w file and the control is then passed to an html file (after the data has been successfull loaded into the TEMP-TABLE). The html is responsible to view all the data present in the TEMP-TABLE. And I have some .i files which are given further responsibilty BY html file to loop through the TEMP-TABLE and do whatever is necessary to pull the data.

Since I have a GLOBAL TEMP-TABLE I need to maintain this in a session specific to each user. When user logs out or close their browswer the GLOBAL TEMP-TABLE is destroyed. And again each user will have its own GLOBAL TEMP-TABLE specific to their own session.

Any help is much appreciated. If anyone could direct me to a resource where this issue is elaborated would be of great help.


Have a great Christmas Progress Community!!

Best Regards,

Jatinder

All Replies

Posted by Matt Baker on 04-Dec-2009 12:51

Webspeed has a couple of different operating modes.  You can use state-aware which binds the client (web browser) to a particular agent.  The broker will then redirect any requests from a particular web browser (based on session id stored in a cookie) to this one agent until that particular agent is released.  You can also use stateless mode in which each webspeed agent will serve whatever request comes next based on webspeed broker (round-robin scheduling).

A state-aware programming model is harder, since you risk locking agents and you have to deal with timeouts.  It also doesn't scale well since you limit your user counts to the number of webspeed agents that you have.

Webspeed does not have any global session handling of data that is shared across agents.

The normal model for this kind of thing is to use stateless mode and store any session state in a table in a database.  In your case you would need to load the data of the temp-table on each request, and write it out to the database at the end of the request.  There is an example implementation in webspeed installation that can give you a model for this /src/web/method/session.i and /src/web/objects/session.p.

Message was edited by: Matthew Baker

Posted by Admin on 04-Dec-2009 12:52

Take a look to proc/SaveUserContext.p, proc/libBO.i and index.p

This thread is closed