Skip to content

Commit 5f006cc

Browse files
authored
Update 05_cookie.sql
1 parent 52dfc7c commit 5f006cc

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

examples/official-site/sqlpage/migrations/05_cookie.sql

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
INSERT INTO component (name, description, icon)
33
VALUES (
44
'cookie',
5-
'Sets a cookie in the client browser, used for session management and storing user-related information.
6-
7-
This component creates a single cookie. Since cookies need to be set before the response body is sent to the client,
8-
this component should be placed at the top of the page, before any other components that generate output.
5+
'
6+
Sets a cookie in the client browser, used for session management and storing user-related information.
97
10-
After being set, a cookie can be accessed anywhere in your SQL code using the `sqlpage.cookie(''cookie_name'')` pseudo-function.',
8+
This component creates a single cookie. Since cookies need to be set before the response body is sent to the client,
9+
this component should be **placed at the top of the page**, before any other components that generate output.
10+
11+
After being set, a cookie can be accessed anywhere in your SQL code using the `sqlpage.cookie(''cookie_name'')` pseudo-function.
12+
13+
Note that if your site is accessed over HTTP (and not HTTPS), you have to set `false as secure` to force browsers to accept your cookies.',
1114
'cookie'
1215
);
1316
-- Insert the parameters for the http_header component into the parameter table
@@ -119,4 +122,4 @@ SELECT ''text'' as component,
119122
''Your name is '' || COALESCE(sqlpage.cookie(''username''), ''not known to us'');
120123
```
121124
'
122-
);
125+
);

0 commit comments

Comments
 (0)