John DeSol just pointed out that my idea would not work.. I just did some 
testing to see what John was talking about. 

Using Firefox and Xojo I ran the following test with cookies enabled…

session.Cookies.Set("testing","test")
if Session.Cookies.Value("testing") = "test" then
  MsgBox "Cookies are NOT disabled: "+Session.Cookies.Value("testing")
  
else
  MsgBox "Cookies are MAY BE disabled: "+Session.Cookies.Value("testing")
  
end if

As expected it reported that cookies were NOT disabled. Watching cookies in the 
Web Developer Storage tab in Firefox. however, I could not see the cookie until 
I refreshed the browser. 

Then I ran the same thing with cookies disabled and surprisingly I got that 
cookies were still NOT disabled. In the storage tab as before I could not see 
the cookie, only this time when I refreshed the browser, I still did not see 
the cookie.

After a bit of more testing, I have concluded that as John stated cookies are 
not in fact set until the browser receives a request subsequent to the one that 
sets the cookie. 

I will be exploring further why Xojo is seeing the cookie when in fact it has 
not been set. I suspect that it is not really reading the cookie from the 
browser but instead storing the cookie value for the duration of the current 
request. Perhaps it has to, since it really cannot be read from the browser yet.

In any event, I do not think that testing for a test cookie is going to work. 
At least it will not work using a Xojo web app.

John






> On Jun 5, 2018, at 10:31 AM, Jim Labos - infobase via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Thanks John. That was my thought too but I thought maybe someone had some
> other "magic" trick. It's clear now there is none in this case.
> 
> It's cumbersome but it will need to be processed as you stated. Since it's
> not a single call I can be checking if the Cookie was created on first hit
> and proceed from there.
> 
> Cheers
> 
> 
> 
> 
> 
> -----
> Jim Labos - infobase
> --
> Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to