1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Session management for Ferro framework
//!
//! Provides Laravel-like session handling with database storage.
//!
//! # Features
//!
//! - Secure session cookies (HttpOnly, Secure, SameSite)
//! - Database-backed storage for scalability
//! - CSRF token generation per session
//! - Flash messages for one-time notifications
//! - Session data stored as JSON
//!
//! # Example
//!
//! ```rust,ignore
//! use ferro_rs::session::{session, session_mut};
//!
//! // Read from session
//! if let Some(s) = session() {
//! let name: Option<String> = s.get("name");
//! }
//!
//! // Write to session
//! session_mut(|s| {
//! s.put("name", "John");
//! s.flash("success", "Item saved!");
//! });
//! ```
//!
//! # Setup
//!
//! Add the `SessionMiddleware` to your bootstrap:
//!
//! ```rust,ignore
//! use ferro_rs::{global_middleware, SessionMiddleware, SessionConfig};
//!
//! pub async fn register() {
//! let config = SessionConfig::from_env();
//! global_middleware!(SessionMiddleware::new(config));
//! }
//! ```
pub use SessionConfig;
pub use DatabaseSessionDriver;
pub use ;
pub use ;