ring

jtth 2020-04-20T16:11:07.029300Z

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

jtth 2020-04-20T16:11:49.029400Z

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

jtth 2020-04-20T19:25:13.029600Z

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 %}

jtth 2020-04-20T20:24:01.030500Z

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)))

2020-04-21T14:29:20.031Z

Where are you getting session from?

2020-04-21T14:30:05.031300Z

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

jtth 2020-04-21T16:25:45.031700Z

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

2020-04-21T16:55:03.031900Z

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

jtth 2020-04-21T17:09:23.032100Z

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

2020-04-21T17:10:00.032300Z

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

2020-04-21T17:12:43.032500Z

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

jtth 2020-04-21T17:15:51.032700Z

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.

2020-04-21T17:18:26.032900Z

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

2020-04-21T17:18:55.033100Z

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

jtth 2020-04-21T17:22:04.033300Z

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.

jtth 2020-04-21T17:24:46.033500Z

Ah. It doesn’t.

2020-04-21T17:25:36.033700Z

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.

jtth 2020-04-21T17:26:09.033900Z

Yeah, I’m seeing that now.

jtth 2020-04-21T17:26:43.034100Z

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

jtth 2020-04-20T20:24:46.030800Z

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