<%!*******************************************************************%> <%! Note that this text document contains Shadow Web Server HTML *%> <%! Extensions and is used to dynamically generate 4 different *%> <%! pages, depending on which query variables and cookies are *%> <%! transmitted on the in-bound request. *%> <%!*******************************************************************%> <%response.addheader "Pragma" "nocache"%> <%response.addheader "Expires" "Tue, 09 Mar 1999 01:01:01 GMT"%> Automated State Management Facility (ASMF) - Cooke Demo <%if www.var.FORMNAME EQ 'REGFORM'%>

Automated State Management Facility (ASMF)

HTTP Cookie Handling Demonstration


 

Thank You <%www.var.Firstname%> For Registering

The server is sending an HTTP cookie along with this page, so that your browser will remember your registration information for a few months. <% glvstate.0.trace = 'yes' %> <% glvstate.asmfa101_reg = "NEW(COOKIE)" %> <% glvstate.asmfa101_reg.value.fullname = www.var.USERNAME %> <% glvstate.asmfa101_reg.value.fname = www.var.FIRSTNAME %> <% glvstate.asmfa101_reg.value.TV = www.var.TVSHOW %> <% glvstate.asmfa101_reg.value.FOOD = www.var.SNACK %> <% glvstate.asmfa101_reg.domain = swsinfo(hostdomain) %> <% glvstate.asmfa101_reg.path = "/neon/asmfa100" %> <% glvstate.asmfa101_reg.expires = 129600 %>

The HTTP cookie, in an encoded form, will contain the following information, and should be sent back to the server each time you access this application from now on, or until you request that it be deleted.

Cookie Name: SWSSTATE_ASMFA101_REG <%do glvstate.asmfa101_reg.key.0%>
Subkey <%htxindex%> (<%glvstate.asmfa101_reg.key.%>): <%glvstate.asmfa101_reg.key..value%> <%enddo%>
Domain: <%glvstate.asmfa101_reg.domain%>
Path: <%glvstate.asmfa101_reg.path%>
Minutes Till Expiration: <%glvstate.asmfa101_reg.expires%>

 

 

 


<%exit%> <%endif%> <%if www.var.FAction EQ 'KILLME'%>

Automated State Management Facility (ASMF)

HTTP Cookie Handling Demonstration


 

HTTP Cookie Deletion

The server is sending an HTTP cookie along with this page, which will kill off the registration data you previously submitted. It does this by sending a new cookie with the same name, domain, and path, but specifies an expiration date in the past. <% glvstate.0.trace = 'yes' %> <% glvstate.asmfa101_reg = "NEW(COOKIE)" %> <% glvstate.asmfa101_reg.domain = swsinfo(hostdomain) %> <% glvstate.asmfa101_reg.path = "/neon/asmfa100" %> <% glvstate.asmfa101_reg.expires = -4000 %>

The HTTP cookie will contain the following information.

Cookie Name: SWSSTATE_ASMFA101_REG
Value: "<%glvstate.asmfa101_reg.value%>" (NULL)
Domain: <%glvstate.asmfa101_reg.domain%>
Path: <%glvstate.asmfa101_reg.path%>
Minutes Till Expiration: <%glvstate.asmfa101_reg.expires%>

 

 

 

 

 


<%exit%> <%endif%> <%if glvstate.asmfa101_reg NE 'VALID'%>

Automated State Management Facility (ASMF)

HTTP Cookie Handling Demonstration


 

Welcome New User

Since this is your first time here, please register with this application. Your registration information will be saved into a persistent HTTP cookie, so the next time you return here, your personal information will be readily at hand.

Of course, this 'application' is designed merely to illustrate Shadow OS/390 Web Server's Automated State Management Facility (ASMF) support for handling HTTP cookies. The entire 'application' consists of a single HTML page containing HTML Extensions. The extension statements manage the cookie by setting and interrogating the value of GLVSTATE. variables.

 

Your Name:
 
Your Favorite TV Show:
 
What Goes Best With
Your Favorite Show?
Chocolate Chip Cookies 
Chips and Dip
Popcorn
A Cold Beer
   

 


<%exit%> <%endif%>

Automated State Management Facility (ASMF)

HTTP Cookie Handling Demonstration


 

Welcome Back <%glvstate.asmfa101_reg.value.FNAME%>

The browser has sent an HTTP cookie containing your registration information so that your name and preferences are known to this application. The HTTP cookie contains the following information in encoded form:

Cookie Name: SWSSTATE_ASMFA101_REG <%do glvstate.asmfa101_reg.key.0%>
Subkey <%htxindex%> (<%glvstate.asmfa101_reg.key.%>): <%glvstate.asmfa101_reg.key..value%> <%enddo%>

 

What's Next?

You can cause the cookie to be killed-off by clicking the button below. This will generate another Set-cookie: response with a back-dated expiration date.

You can also view the un-expanded HTML source text which implements this application.