Hello! Nice to meet everyone! Random question reg...
# server
f
Hello! Nice to meet everyone! Random question regarding the Sessions plugin. Is it possible to use this plugin to just simply store a JWT string in the cookie. I want to opt to not use Authorization headers for my use case. So something like
Copy code
cookie<String>("SESSION") { ... }
The documentation just alludes to always signing/transforming the cookie (as well as making a data class instead of using String), but my JWT is already encrypted. Then I'm calling
Copy code
val accessToken = ...
call.sessions.set(accessToken)
But the header response looks like
Copy code
Set-Cookie: SESSION=length%3D%2523i536; ...
instead of what I wanted to expect as
Copy code
Set-Cookie: SESSION=eyJhbG.....
Thanks! And if there's no easy solution, no big deal. I can just manually set the cookie header myself, just was curious if I could use the plugin just because its cleaner. Oops: Just realized this isn't a KTOR specific channel. Please let me know if I should ask somewhere else, or go to KTOR github next! Thanks.
d
#ktor 🙃
f
Oh thanks! I didn't realize there were more channels you can join, wasn't in the default I saw on the list Will head over there!