Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a cookie from callback function #182

Closed
oryba opened this issue Dec 27, 2017 · 3 comments
Closed

Set a cookie from callback function #182

oryba opened this issue Dec 27, 2017 · 3 comments

Comments

@oryba
Copy link

oryba commented Dec 27, 2017

It seems that setting a cookies from callback function is currently impossible. I think it would be great if this feature will appear in the future versions.

Thank you:)

@ned2
Copy link
Contributor

ned2 commented Dec 27, 2017

My immediate thought was that this could be done with a callback that inserts a <script> tag with some JavaScript that sets a cookie, but according to MDN, the html5 spec says that <script> tags inserted via innerHTML should not execute. So no go there.

There are other ways to get arbitrary JS code to execute via innerHTML, which might work (the same MDN article provides an example of how), but at that point it's definitely a hack job.

@oryba
Copy link
Author

oryba commented Dec 28, 2017

Thank you for response!

Interesting and useful workaround. But despite the fact it's a hack job, setting httponly cookie couldn't be done this way.

@chriddyp
Copy link
Member

chriddyp commented Jun 8, 2018

I suspect this could be a custom Dash component.

What's the use case that you have in mind?

HammadTheOne pushed a commit to HammadTheOne/dash that referenced this issue May 28, 2021
HammadTheOne pushed a commit to HammadTheOne/dash that referenced this issue May 28, 2021
* - alter editable / readonly behavior

* bump version

* remove phantom file

* update docs

* fix lint issues

* update variable names

* remove merge file!
HammadTheOne pushed a commit that referenced this issue Jul 23, 2021
* - alter editable / readonly behavior

* bump version

* remove phantom file

* update docs

* fix lint issues

* update variable names

* remove merge file!
HammadTheOne pushed a commit that referenced this issue Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants