ixhbinphoenix / actix-session-surrealdb

http://crates.io/crates/actix-session-surrealdb
MIT License
9 stars 1 forks source link

documentation demonstrates incorrect key generation #2

Closed robjtede closed 1 year ago

robjtede commented 1 year ago

in both the readme and crate docs you have this snippet:

    HttpServer::new(move || {
        App::new()
            .wrap(
                SessionMiddleware::builder(session_store.clone(), Key::generate())

this is very subtly incorrect as it will generate a different key for each server worker

please amend it to

    let key = Key::generate();

    HttpServer::new(move || {
        App::new()
            .wrap(
                SessionMiddleware::builder(session_store.clone(), key.clone())

and publish a new release so users of this crate can copy-paste from the updated crates.io page

ixhbinphoenix commented 1 year ago

Thank you for opening an issue for this, would have never noticed that

robjtede commented 1 year ago

fixed the other occurence in #3