[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sessions/cookies issues with postgres
From: |
Mortimer Cladwell |
Subject: |
Re: sessions/cookies issues with postgres |
Date: |
Mon, 2 Nov 2020 06:39:02 -0500 |
db.engine =
in artanis.conf will eliminate the appending of "db.engine = InnoDB" to the create table statement and allow the initialization script to create the table.
Concerning cookies - with the view:
--------VIEW--------------------
<html><head><title><%= (current-appname) %></title></head>
<body>
<h1>test#sessiontest</h1>
<p>Rendered from app/views/test/sessiontest.html.tpl.</p>
<%= check-value %>
</body>
</html>
And controller:
-------CONTROLLER---------------
(get "/sessiontest"
#:cookies '(names sid user project)
(lambda (rc)
(let* (
(check-value (rc-cookie rc))
(view-render "sessiontest" (the-environment) ))
))
--------------------------------
Header content:
((host "127.0.0.1" . 3000) (user-agent . "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0") (accept (text/html) (application/xhtml+xml) (application/xml (q . 900)) (*/* (q . 800))) (accept-language (1000 . "en-US") (500 . "en")) (accept-encoding (1000 . "gzip") (1000 . "deflate")) (cookie . "sid=sometext; user=myname") (connection keep-alive) (upgrade-insecure-requests . "1") (if-modified-since . #<date nanosecond: 0 second: 40 minute: 58 hour: 10 day: 2 month: 11 year: 2020 zone-offset: 0>))
Using the above controller:
Command: (check-value (rc-cookie rc))
Results of check-value: (#)
Command: (check-value (rc-set-cookie! rc '(project . "newproject")))
Results of check-value: (project . newproject) but the new cookie is not present in the cookie console so a fail.
So to summarize I can set cookies from server using (:cookies-set! rc 'sid "sid" "sometext")
I cannot set using (rc-set-cookie! rc '(project . "newproject")) but I am uncertain of this method signature (determined from source code)
I fail to retrieve cookies on the server using (rc-cookie rc) or (:cookies-ref rc 'sid "sid")
What am I doing wrong?
Thanks
Mortimer