I've cut it down to just the basics as I mentioned in my last posting. The table contains a username, accesscode and location columns. You can just use dummy data to create a table to run this, unless you see something so glaring that I'm blind to it...thanks...
<%
IF !EMPTY(UPPER(REQUEST.servervariables('QUERY_STRING')))
response.setcookie( 'lc_username',ALLTRIM(UPPER(REQUEST.servervariables('QUERY_STRING'))),,"/" )
ENDIF
lc_username=ALLTRIM(REQUEST.getcookie('lc_username'))
SELECT * ;
FROM ACCESS ;
WHERE ALLTRIM(username) = ALLTRIM(lc_username) ;
INTO CURSOR temp &&columns accesscode, location
USE IN ACCESS
IF _TALLY = 0
m.errmess = 'You have no permissions in HAP-EP'
SELECT form_text FROM gen_html WHERE form_id LIKE 'note' INTO ARRAY formtxt
m.access = -1
m.hap_access = -1
html_out = mergetxt(M.formtxt)
RETURN
ENDIF
response.setcookie( 'ln_hap_access', ALLTRIM(STR(temp.accesscode)),,"/" )
response.setcookie( 'ln_userid', ALLTRIM(STR(temp.accesscode)),,"/" )
response.setcookie( 'lc_user_loc', temp.location,,"/" )
response.setcookie( 'lc_userloc', temp.location,,"/" )
response.setcookie( 'lc_u_loc', temp.location,,"/" )
m.hap_access = VAL(REQUEST.getcookie('ln_hap_access'))
m.user_loc = REQUEST.getcookie('lc_user_loc')
m.userloc = REQUEST.getcookie('lc_userloc')
m.userid = REQUEST.getcookie('ln_userid')
m.u_loc = REQUEST.getcookie('lc_u_loc')
m.username = REQUEST.getcookie('lc_username')
cur_juldate = getjulian()%>
<HEAD>
<TITLE>Test Page 1</TITLE>
<x-sas-WINDOW TOP=0 BOTTOM=457 LEFT=0 RIGHT=768>
</HEAD>
<body>
<h2 ALIGN=CENTER><FONT SIZE=5>Test Page 1</FONT></h2>
<p><hr><p>
<FONT SIZE=+2><b>
<ul>
</ul>
</b></FONT>
<p>
<hr>
<%response.WRITE(Session.GetSessionID()+" "+IIF(EMPTY(request.getcookie('lc_username')),'No cookie',request.getcookie('lc_username'))+" "+IIF(EMPTY(request.getcookie('lc_u_loc')),'No cookie',request.getcookie('lc_u_loc')))%>
<hr></body>
</html>
<%
RETURN
%>
Sent by FoxWeb Support on 04/19/2005 08:17:52 PM:
FWX files are executed sequentially in the order they appear. In fact, they are converted to PRG files, with all static code being sent via Response.Write. If you want to see one of these PRG files, you can simply enable the Keep PRG Files option in the FoxWeb Control Center. Once you do so, delete the corresponding FXP file (to force re-compilation) and call your FWX file.
Assuming that you have none of the caveats mentioned in our previous message are the cause (mixing old-style html_out code with the new Response, Session and Auth objects, and using PUBLIC variables), then the behavior you are experiencing must be caused by a scripting bug. Try creating a copy of your main page that is as simple as possible. Ideally you will remove all code other than what's necessary to read the cookie, query the table and display the results. If you can duplicate the problem with this script, please post it here (or send it to
support@foxweb.com), so that we can take a look at it.
FoxWeb Support Team support@foxweb.com email |
Sent by Bob Keller on 04/19/2005 07:08:01 PM:
I'm running FoxWeb 2.6 and am attempting to understand how this series of events can be happening with an application I was passed to re-host:
1) The first page receives a query string to extract a user's information and access level from a database.
2) This information is stored in cookies on the client's machine.
3) Each time a page is called, the values of the cookies are placed into memory variables in order to maintain the user's state throughout their session.
4) These memory variables are used throughout the application
Problem:
I've observed the following just on the FIRST page alone, and it would explain some of the problems in my previous postings to this list:
1) For debugging purposes I have the values of the cookies displayed at the bottom of each page.
2) On the initial page when it is first initiated the 'cookie' line states there are no values posted in ANY cookie.
3) Pressing 'Refresh' the values in the cookies appear, however, the username is correct, the other values do NOT match the information for that record in the database, but the first record. This data is extracted with a SQL Select statement WHERE the username=QUERYSTRING value
4) Pressing 'Refresh' a SECOND time on the SAME page, the 'cookie' line now shows all the values as they should be for that particular user.
Now I have 'inherited' this from another person who has been running it for some time with no trouble. He's been most helpful. My server's settings match his exactly, yet he's never (so he says) encountered this.
My question is: what is the 'firing order' of an FWX file. Currently, I have the first page HTML embedded at the end of FoxPro code that takes the querystring and performs validation. It appears the fox code is not firing before the HTML.