You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to debug why every page access creates a new session key on my Redis instance and it turns out accessing SessionVar.value in a Diet template was automatically starting a session, except doing so in a Diet template results in client not receiving the session cookie for some reason. Calling startSession() or accessing SessionVar.value in a normal registered methods work as expected.
I think this is a pretty severe and hard to debug issue.
The problem is that Diet templates are rendered directly to the wire, so that the response header has already been written once you get to the processing of the template. So there really is no general fix for this, apart from manually rendering to a buffer and using HTTPServerResponse.writeBody afterwards, or just issuing the startSession before rendering the template.
On the other hand, it makes sense to think about whether there is a good possibility to generate a warning to make this easier to detect/debug.
I see, that makes sense. Thanks for the quick response.
I think we can design some sort of locking mechanism for InetHeaderMap which will deny any modifications while locked and then HTTPServerResponse.bodyWriter would hold the lock until it's closed/destroyed.
I was trying to debug why every page access creates a new session key on my Redis instance and it turns out accessing
SessionVar.value
in a Diet template was automatically starting a session, except doing so in a Diet template results in client not receiving the session cookie for some reason. CallingstartSession()
or accessingSessionVar.value
in a normal registered methods work as expected.I think this is a pretty severe and hard to debug issue.
The text was updated successfully, but these errors were encountered: