EDIT - I was asked to provide a minimal example. This is a basic example that still does not display cookies.
In a Google Sheet, I go to Tools-->Script Editor. Here, I have two files:
Code.js:
function doGet(e) {
index.html:
output = HtmlService.createTemplateFromFile('index');
return output.evaluate();
}<!DOCTYPE html> <html> <head> <base target="_top"> <script> document.cookie = "username=John Doe"; var x = document.cookie; console.log( "Hello World" ); console.log( x ); </script> </head> <body> index </body> </html>
When the site loads, only "Hello World" is printed to the console
document.cookie = "user=John; SameSite=none; secure"; (ensuring the SameSite and Secure options are added)
the cookies work fine.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/e1ee64c9-3993-4ec0-a084-7049a87ac719o%40googlegroups.com.
Google Apps Script is a great tool for programmers of all levels to explore new ideas. @mhawksey shares how Apps Script has removed barriers in education by easing administrative duties, allowing teachers more time to focus on students.
— G Suite Developers (@GSuiteDevs) August 10, 2020
Learn more → https://t.co/HGgCjTgMuK pic.twitter.com/MFwEO9GZV0