//! A service for CSRF protection.
use crateRequest;
use cratetoken;
use crateSession;
/// Returns a random token to be used in the html form to mitigate a csrf attack.
/// # Examples
/// ```
/// use kalgan::service::csrf;
///
/// let token: String = csrf::get_token();
/// assert_eq!(token.len(), 200)
/// ```
/// Checks whether the cookie contained in the request matches the csrf session stored in redis.