[][src]Function warp_sessions::reply::with_session

pub async fn with_session<T: Reply, S: SessionStore>(
    reply: T,
    session_with_store: SessionWithStore<S>
) -> Result<WithSession<T>, Rejection>

Accepts a type that implements warp::Reply and a SessionWithStore and binds the session to the reply. It does this by first saving any changes to the session, and then adding a session ID cookie to reply containing the ID of this particular session. When the request::with_session filter runs, it will pick this cookie up and restore the session from the store.