Fork me on GitHub
#ring
<
2020-04-20
>
jtth16:04:07

is there a middleware for displaying session information in a footer or something? or do i have to do that by hand?

jtth16:04:49

like the debugging/error page that looks like rails’, but just… always there showing params/session info

jtth19:04:13

answering my own question: at least for selmer, my question was really how do i pass parameters into a template, which is done with {% debug %}

jtth20:04:01

so after login i’m redirecting to another page using the following, but it doesn’t seem to preserve session information. any ideas on where i should look?

(-> (response/found "/authenticated-test")
        (assoc :session (assoc session :identity user-identity)))

jtth20:04:46

there isn’t even a :session value in :params. (This is based on the luminus template. I’ll ask in there too.)

weavejester14:04:20

Where are you getting session from?

weavejester14:04:05

Are you pulling it from the request, and have you added the session middleware?

jtth16:04:45

I tried putting wrap-session above the wrap-defaults and nothing changed.

weavejester16:04:03

You shouldn’t need an additional wrap-session if you already have wrap-default. Have you tried using a different session store?

jtth17:04:23

just tried setting it to cookie-store following https://luminusweb.com/docs/sessions_cookies.html and there’s no change.

weavejester17:04:00

Have you checked the browser to see if the cookie is being set correctly?

weavejester17:04:43

Have you checked the session directly? Perhaps the problem is with how you’re integrating it into Buddy.

jtth17:04:51

I think I’m passing these things on but honestly I don’t know. I’m trying to follow documentation, and this looks like what everyone else is doing. I don’t want to have to worry about this stuff; I guess I figured that in a mature library ecosystem this would be a solved problem.

weavejester17:04:26

Why do you think the session information isn’t being preserved?

weavejester17:04:55

Also by your use of :identity are you using Buddy authentication? If so, where have you set it up?

jtth17:04:04

entire repo is here: https://bitbucket.org/jtth/irbportal/src/master/. I don’t think the session information is being preserved because I can’t see it as accessible from my templates. The CSRF code gets passed. I figured luminus would pass it on to the layout function (because literally if it did not what would be the point of the template at all?) but I have assumed my way into a frustrating corner before.

jtth17:04:46

Ah. It doesn’t.

weavejester17:04:36

It looks like you’re passing the request into the template, but then assuming that there’s an :identity key? But I don’t see where that would come from.

jtth17:04:09

Yeah, I’m seeing that now.

jtth17:04:43

Once again, I assumed the point of the template would be to be helpful and pass the whole session to the template… ug.