0

I m developing a web application using webspeed. My code is written in cgi-wrappers only. Currently i'm working on managing wesession (all its cases). Now the problem is, when I refresh my page using F5 key, my .p is creating a new session id always. How can I tackle such situation in .p? This problem is not coming when code is written in .html files but when code is completely written in .p files

Thanks.

newprogress
  • 157
  • 1
  • 2
  • 11

2 Answers2

0

You need a better way to identify sessions. Take a look in here and see if there's something useful: http://freeframework.sourceforge.net/

Tim Kuehn
  • 3,201
  • 1
  • 17
  • 23
0

Most people in the OpenEdge world write their own session handling (myself included), although there are some alternatives.

As Tim mentions, there is the Free Framework, which has been around for 12 years now, but I don't know whether it's still being actively developed.

The eScript framework is an excellent replacement for WebSpeed, allowing you to split business logic & UI. You'll be aware that using cgi-wrappers is a pain for your string handling (quotes and double quotes for JavaScript code inside of 4GL strings is a nightmare). The full framework (I believe there's an ongoing licence to use the full framework) has full session handling built in.

I believe that there is going to be a brand new framework released in the next 12 months by the eScript developer as a replacment for eScript; for more information sign up to the eScript developer's mailing list at Rule Six (his name's Matt Verrinder, and I'm in no way affiliated with him).

I myself use the basic eScript web object. This doesn't have ongoing licensing (you just have to take some up front consultancy from Matt) and gives you the benefits of the business logic/UI split on the cheap. You still have to write your own session handling, of course.

A good resource for OpenEdge developers is www.progrestalk.com: you're more likely to get useful answers there than on Stackoverflow. If you do a search on their forums you'll find plenty of information about session handling.

OpenEdge does have session handling built in. Here's an excerpt from a thread on Progresstalk:

On the messenger you need to set in $DLC/properties/ubroker.porperties: useConnID=1 in the environment section of the webspeed agent you need to set SESSION_PATH. This should point to a directory where you woud like to store the session variables. If you have done this then you can use setSession("VarName","VarValue") to set variables and getSession("Varname") to retrieve values. The sessionvariables are stored in a file name ENCODE(SESSION:SERVER-CONNECTION-ID).tmp.

This method of has its flaws like: Values are always stored as character and maximum size of file is 32K (well at least it used to be) and so on. But if the stuff youy are going to do isn't too complicated then its a good starting point. One can always expand this by starting to implement there own sessionManager.

Hopefully there's some useful information in there you can use!

Ian Stanway
  • 610
  • 8
  • 25