Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

ASP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ASP

    I'm an AS/400 programmer and have been programming a lot of web sites using Microsoft Active Server pages. I now want to build a site on the AS/400 and am excited about what CGI processing can do. However, I am concerned because I don't know how to emulate "session variables" on the AS/400. A session variable is a variable you can create during a session that carries through your session until you exit. For creating an order, I would like to store an order number in something on the AS/400 (like an ASP session variable) that would follow the user throughout the entire session. I don't want to pass the order number as a querystring or in the stdin data stream unless I absolutely have to. Is there a mechanism on the AS/400 I can use to attach data to a user's session? Thanks much, Jim Quinlan Clearwater, FL

  • #2
    ASP

    One is a library called QTEMP; the other a data area *LDA. bobh

    Comment


    • #3
      ASP

      The 'Local Data Area' *LDA may be of help (DSPDTAARA *LDA).

      Comment


      • #4
        ASP

        You can use a datarea or the LDA (Local Dataarea). You could also pass the value as a parameter from program to program. There are values that can be retreived at anytime from an application like: user, job , program etc.. if that is the type of information you are looking for. HTH

        Comment


        • #5
          ASP

          Jim, One of the challenges for programming in CGI is to maintain the persistent state for a session. This is true for all the CGI, regardless whether it is AS/400 or other platforms. For AS/400, you can config the web server to use persistent CGI, and it will maintain a session like a AS/400 job. This allows files to remain open and the value in all the fields remain unchange after the first output. To do that, your CGI program must notify the sever that you want to remain persistent by output "Accept-HTSession" CGI header with a random number as the key or handle. In addition, your CGI program must use named activation group. However, you must code the key or handle as part of your query string, which you don't like. I personally still prefer using cookie and maintain my own session. That way I can reuse the same thread or job to serve mulitple clients. You can find out more information about AS/400 persistent CGI on AS/400 manual - Web Programming Guide. I hope this help, and I like to hear your opinion about the pros/cons using MS ASP and AS/400 CGI after this. Shawn Fu shawnf@o-s.net

          Comment


          • #6
            ASP

            Thanks Shawn, You hit it on the head whereas other responses I had talked about QTEMP and *LDA which wouldn't be there if the session state wasn't maintained. I'll look deeper into those topics and check out the manuals. How does the AS/400 do cookies (Write and read)? The more I think about your statement preferring cookies, I agree that method is probably the cleanest. If I could store a Current order# in a cookie, I could use that to communicating between my pages. If I get to do this project, I'll let you know how I compare ASP to AS/400. I love ASP programming but can't turn my back on the AS/400 after 15 years in this field. Jim Quinlan Clearwater, Florida

            Comment


            • #7
              ASP

              Qtemp and *LDA don't follow the browser as a one clicks from web page to web page. A job doesn't start unless (According to Shawn) you use persistent CGI. Thanks for the response though, Jim Quinlan Clearwater, Florida

              Comment


              • #8
                ASP

                Qtemp and *LDA don't follow the browser as a one clicks from web page to web page. A job doesn't start unless (According to Shawn) you use persistent CGI. Thanks for the response though, Jim Quinlan Clearwater, Florida

                Comment


                • #9
                  ASP

                  Jim, To write or output a cookie, use the standard CGI header output with Set-Cookie: order#parm=123456789; path=/; domain=.your domain.com; secure To retrieve or read the cookies, you need to do get environment variable with HTTP_COOKIE variable via IBM API program. Shawn Fu

                  Comment

                  Working...
                  X