Defines functions for state that can persist accross server requests
- startSession :: FrameRouter m => m Fields
- saveSession :: FrameRouter m => m ()
- deleteSession :: FrameRouter m => m ()
- withSession :: FrameRouter m => ([String] -> m a) -> [String] -> m a
- genSessionId :: IO String
- getSessionField :: FrameReader m => FieldName -> m (Maybe WrapperType)
- delSessionField :: FrameState m => FieldName -> m ()
- copyToSession :: FrameState m => FieldName -> m ()
- copyFromSession :: (FrameState m, FrameConfig m) => FieldName -> m ()
- updateFlash :: FrameState m => String -> m ()
- getDelFlash :: FrameState m => m (Maybe String)
- flash :: FrameRouter m => m Data -> m Data
Session management
startSession :: FrameRouter m => m FieldsSource
Recovers a session from persistent storage
saveSession :: FrameRouter m => m ()Source
Saves a session to persistent storage
deleteSession :: FrameRouter m => m ()Source
Deletes a session from persistent storage
:: FrameRouter m | |
=> ([String] -> m a) | A router to run |
-> [String] -> m a | A router wrapped with a session |
A convenience function when running a router, starting and saving a function before and after the router is run
genSessionId :: IO StringSource
Generate a unique session ID
Session manipulation
:: FrameReader m | |
=> FieldName | The FieldName to get from the session |
-> m (Maybe WrapperType) | The session field (if found) |
Get a field from the session by FieldName
:: FrameState m | |
=> FieldName | FieldName to be deleted |
-> m () |
Deletes a specific field in the session by the given field name
:: FrameState m | |
=> FieldName | The FieldName to be copied to the session |
-> m () | Nothing (but the modified state) is returned |
Copy a particular field to the session from the fields in the state
:: (FrameState m, FrameConfig m) | |
=> FieldName | The FieldName to be copied from the session |
-> m () | Nothing (but the modified state) is returned |
Copy a particular field to the session from the fields in the state
:: FrameState m | |
=> String | Message to flash to the screen |
-> m () | Nothing (but the modified state) is returned |
Overwrite a message to be flashed to the screen (persisting across requests)
getDelFlash :: FrameState m => m (Maybe String)Source
:: FrameRouter m | |
=> m Data | The router to have the message flashed to |
-> m Data |
Given a router, flashes the current message to screen before deleting it