The user session and any session variables added to it should still exist in your FoxWeb server when the user is linked back to MyFoxWebPage3.fwx. The trick is to make sure that the browser sends the session cookie back, so that FoxWeb can relate the latest visit with the session prior to the php page. In order for this to happen, the server name and port must be identical in the two sessions. To make things harder, the host name is case sensitive! As a test, try the SessionDemo sample. First visit your server as you normally do:
Set a session variable and make sure it appears in the list.
Now change the case of letters in the host name part of the URL in the location bar and press enter:
You will notice that the session variable you created is no longer there. This is because your browser does not recognize this request as going to the same server as before, so it does not send the session cookie. You will also notice that, if you change the host name back to what it was, the session variable will reappear.
I focused on case sensitivity, because it's a frequent gotcha, but the same is true if in one session you use the host name and later switch to an ip address, or a different host name that resolves to the same server.
Of course you can't control what your users will enter in their location bar when they first visit your FoxWeb site, but you can control the return host name from the PHP site. The trick is to make sure that the host name is the same when the session variable is created in the first place. The best way to do so is to check Request.ServerVariables("SERVER_NAME") and redirect the user to the "correct" host name in MyFoxWebPage1.fwx:
IF Request.ServerVariables("SERVER_NAME") != "www.myserver.com"
... (the rest of your page1 content)
FoxWeb Support Team
Sent by Joe Goldsmiith on 04/07/2012 10:50:34 PM:
Spoke too soon but also thanks. Here is more information on the application.
When the php script finishes and returns to my FoxWeb page I need to capture the users session variable so I also can update a table that the process was completed. This is for legal reasons.
It's hard to describe because of IP privacy issues. But, the process is this (all pages reside on my server):
MyFoxWebPage1.fwx --> MyFoxWebPage2.fwx -->PHPPage.php (with iframe) --> MyFoxWebPage3.fwx
MyFoxWebPage1.fwx is an introduction page also asking to verify user information. This page also sets Session.SetVar('gID',lID) to start a session ID. If verified the user is taken to...
MyFoxWebPage2.fwx that offers specific information associated with IP issues and asks user to attest to agree. IF agreed the user is taken to...
PHPPage.php (with iframe) sets up the php environment to issue the iFrame. Within the iFrame a page is called from the vendor's web site for the user to interact. Once completed the vendor's site closes the iFrame and returns to...
MyFoxWebPage3.fwx that thanks the user for completing the form. The Fox code also updates the user's record that the process was completed. This is where I need to grab this user's session variable to locate the correct user's record to update.The URL that returns to this page is NOT on the php page. I had to log into my vendor's site and enter the return URL into my profile. This entry instructs the process to return to this page.
I hope this more detailed information is helpful. I'd prefer to know a way for MyFoxWebPage3.fwxto pick up the specific user's session variable from the FoxWeb server. If this is possible how would I do it? I tried using sID=Session.GetVar('gID') but is comes back empty
Any thoughts would be appreciated.
Sent by FoxWeb Support on 04/04/2012 11:18:39 AM:
FoxWeb Support Team
Sent by Joe Goldsmiith on 04/03/2012 08:45:49 PM:
I have a FoxWeb application where I set a session variable such as Session.SetVar('gVID',M.vID) in an fwx page. This page then redirects to a php page using Response.Redirect("myapp.php?tType="+M.tType+"&myalias="+M.alias+"&First="+M.First+"&Last="+M.Last). This page then sets up an environment ending with an iframe to a 3rd party. The iframe is loaded, the user interacts with the page then chooses to close the application page. Upon closing there is a redirect to thanks.fwx page thanking the user using Response.Redirect("http://www.thanks.fwx").
Sooo, my question is how do I pass a session variable from an fwx to a php and then back to another fwx?
Any help is appreciated.