If I check it right after the value of ID_WAPP is set, but in the Opening event of this container that sits on a web page the following code shows no value.
var cID_WAPP As String = Session.Cookies.Value(“ID_WAPP”)
Can someone point me in the direction of doing this correctly so the cookie is retained. I’m running this in my local browser for right now.
So… cookies are stored on the browser and only sent to the web app when the browser loads the app. Because Xojo web apps don’t reload on every page, the data is not sent again until you refresh the browser or reconnect.
A better plan would be to use a dictionary or other property on Session where you store the value whenever it is set or loaded. Then you can reference it at any time.
So if I am understanding what you are saying, I should get the value of the cookies in the opening event of the session? Trying to get them in the first webpage loaded is too late?
It looks like what you may have failed to point out was mentioned in this thread. Can’t test in Safari when connected to an unsecured connection such as local browser. Safari only stores the cookies temporarily. it would be nice is this was mentioned in the docs.
I hope that’s not true. Surely running over a non-secure connection is the exception to the rule not the standard. IMHO, Xojo should always be aiming to protect developers from having to secure their apps if at all possible.
Strict causes the browser to only send the cookie in response to requests originating from the cookie’s origin site. This should be used when you have cookies relating to functionality that will always be behind an initial navigation, such as authentication or storing shopping cart information.
The problem is the current default isn’t Secure, it’s Off (None). Lax is the default value browsers are using, so we’ll be following them in this case.
In implementing cookies, I found the Framework was behaving differently than the way web browsers do, which was unexpected. Xojo made it unnecessarily complicated (see above) to set a short-lived cookie.