Closed kakserpom closed 3 months ago
SessionState should also be public. It's just a type alias but I also had to copy-paste it.
Please open a different issue for the SessionState
discussion.
I think the choice to keep it private is that it might not be a good choice for all session implementations and that it just happens to work well for the built-in storage impls.
Seeing the desire to re-use it in 3rd party impls is a good indicator that it should be publicl; I'd accept a PR.
If someone picks this up and creates a PR I think we should change the implementation to use rand::DistString::sample_string()
to remove some unwraps: https://docs.rs/rand/0.8/rand/distributions/trait.DistString.html
I really appreciate this change, but why does the function have to be hidden specifically behind the redis-session
feature? I'm using the function as I'm implementing my own session store, i.e. I'm not using Redis. redis-session
introduces a total of 12 new dependencies in my Cargo.lock
.
@sjoqvist removed the feature guard in v0.10.1
I've implemented my own session store and I had to copy-paste generate_session_key() instead of just calling it.