I can't retrieve cookies value

I can’t find sample for using cookies in xojo so I made a simple xojo web app on how to use cookies.

Unfortunately, I can’t able to retrieve the cookie value after I refresh the browser.

Any thought of this?

sample file xojo 2025 project >> https://limewire.com/d/685yC#Q5annkhXgs

Can you show the code you’re using to set the cookie so I don’t have to download your project?

Set:

Var d As DateTime = DateTime.Now  
Session.Cookies.Set("CookieTest", TEXTFIELD1.TEXT, D.AddInterval(0,0,3))

Get value:

Dim ResultFromCookieTest As String
ResultFromCookieTest= Session.Cookies.Value("CookieTest")

If ResultFromCookieTest <> "" Then
  MessageBox("Cookies enabled")
Else
  MessageBox("Cookies disabled")
End If

Thanks AlbertoD.

Im sorry, I can’t able to get the value of the cookies after refreshing the browser.

your project is working with me.
I get the cookie back even after closing the session and relaunch the web app.
what is the error you get ?
macos 15 - opera
may be it has something to do with the used browser ?

Actually, It dont have error.

I am wondered why it don’t automatically retrieve the cookies after refreshing the browser.

I found something.

cookies is retrieve when I use google chrome. but when I use safari, cookies is not retrieve.
What might be the issue?

IIRC when Safari connects to an insecure (eg 127.0.0.1 or http) site it only stores the cookie temporarily, so it seems to work, but quit Safari or refresh the Session, and it’s gone. When Safari connects to a secure (ie https) site it stores the cookie permanently.

3 Likes

oh that’s why.

is it possible to imitate https in a debug mode? so that I can try if that’s work on my sample app..

You asked this question 3 years ago:

but you never confirmed if you were able to make it work.

1 Like