Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using (remove-session) and (start-session) for the same request? #235

Open
myrkraverk opened this issue Sep 24, 2024 · 5 comments
Open

Using (remove-session) and (start-session) for the same request? #235

myrkraverk opened this issue Sep 24, 2024 · 5 comments

Comments

@myrkraverk
Copy link

Hi,

I've attempted to start a new session for a GET request, to have a clean session environment for the following POST, by having (remove-session) followed by (start-session). This works sometimes. I'm not exactly sure what the problem is.

The upshot is that the code seems to work now and then. As far as I can tell, if the server sends set-cookie: hunchentoot-session=deleted and so forth, the session will not work, but when not present -- presumably if there was no session in the first place -- it works, and I have a session with all the relevant session-values for the following POST.

Is there a way to make this work? Or will have to do something else?

@stassats
Copy link
Member

If you apply the following, does it work?
x.patch

@myrkraverk
Copy link
Author

Seems so. It always happened sometimes, so I never had a surefire way to trigger it. However, it happened sort of predictably by repeated GET, POST cycles, and now it doesn't.

Thank you.

@stassats
Copy link
Member

I'm not sure this patch can be applied without breaking some existing workflow. So, I guess you can do (setf (session *request*) nil) yourself.

@myrkraverk
Copy link
Author

How exactly would that work? Forgive me for not comprehending exactly how the patch works, even though I reviewed it.

Is it a sequence of

  (remove-session)
  (setf (session *request*) nil)
  (start-session)

in the easy-handler?

@stassats
Copy link
Member

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants