Skip to content

[Auth] - Problem managing session cookie #225

Answered by lovasoa
Ajotah98 asked this question in Q&A
Discussion options

You must be logged in to vote
INSERT INTO session (id, username) values (sqlpage.random_string(32), :username)
RETURNING 
    'cookie' AS component,
    'session_token' AS name,
    id AS value,
    false as secure,
-    '/' as link;
+    '/' as path;

The documentation for the path attribute says

If not specified, the cookie will be sent for all paths.

There was a mismatch between the documentation and the actual behavior. Current versions of SQLPage set the cookie only for the current foler (/action/ in your case) when the path property is omitted. The behavior has been fixed to match the documentation, and will be released in sqlpage 0.19. In the meantime, you have to explicitly set '/' as path in the cookie compo…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@lovasoa
Comment options

@Ajotah98
Comment options

@lovasoa
Comment options

@lovasoa
Comment options

Answer selected by Ajotah98
@Ajotah98
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants