Skip to content

Commit 6a42e05

Browse files
committed
random_string: fix documentation
the example generated two different random strings for the token stored in the database and the one returned to the user as a cookie
1 parent 5f15972 commit 6a42e05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/official-site/sqlpage/migrations/08_functions.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ VALUES (
158158
Generate a random string of 32 characters and use it as a session ID stored in a cookie:
159159
160160
```sql
161-
INSERT INTO login_session (id, username) VALUES (sqlpage.random_string(32), :username)
161+
INSERT INTO login_session (session_token, username) VALUES (sqlpage.random_string(32), :username)
162162
RETURNING
163163
''cookie'' AS component,
164164
''session_id'' AS name,
165-
sqlpage.random_string(32) AS value;
165+
session_token AS value;
166166
```
167167
'
168168
);

0 commit comments

Comments
 (0)