Skip to content

How to set cookie with JS hooks? #4564

Answered by ganigeorgiev
VictorioBerra asked this question in Q&A
Discussion options

You must be logged in to vote

The JSVM method names are camelCased. You can try with:

e.httpContext.setCookie(new Cookie({ ... }))

If you haven't already, you can reference the builtin ambient TS declarations at the top of your .pb.js file to assist you autocomplete and documentation on hover:

/// <reference path="../pb_data/types.d.ts" />

(For HTML version of the above types you can check https://pocketbase.io/jsvm/index.html)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by VictorioBerra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants