Pass Javascript Session Cookie to LiveCode Variable?
Rick Harrison
harrison at all-auctions.com
Thu Nov 5 21:54:33 EST 2020
Hi Matthias,
I found the problem.
You had: put $_Cookie["username”]
It shouldn’t have the quotes.
put $_Cookie[username]
works fine.
I think I made the same mistake sometime! LOL
Cookies reside in the client’s web-browser which is why
as users were are always clearing them out.
So, LiveCode can read Javascript cookies! Yay!
It’s good enough for now. I’ll revisit Javascript session variables later.
Thanks for your help!
Rick
> On Nov 4, 2020, at 2:04 PM, matthias rebbe via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Hi Rick,
>
> i just did a quick test and created an html file which wrote a cookie with javascript
>
> <script type="text/javascript">
> document.cookie = "username=Rick";
> </script>
>
> Then in LC Server i used the array $_cookie to read the content of the cookie
>
> Doing a
> put $_Cookie["username"]
>
> returned Rick
>
>
> Regards
> Matthias
More information about the use-livecode
mailing list