Last updated:
0 purchases
session jar
Session Jar #
A simple server side package for creating and maintaining sessions in dart.
Usage #
import 'package:session_jar/session_jar.dart';
void main() {
//create a session jar
var sessionJar = SessionJar();
//add a session to your sessionjar
var newSession =
sessionJar.create('username', expiresIn: Duration(hours: 12));
//send your session back to the client as a cookie
var cookie = newSession.cookie;
print(newSession.cookie);
//get a session from a cookie
var sessionFromRequest = sessionJar.fromCookie(cookie);
//do something with your session data
print(sessionFromRequest?.body ?? 'session not found!');
}
copied to clipboard
To do: #
❌ Every session has its own expiration timer. this is not efficient in large projects. So I will improve the automatic session deletion in the future.
Features and bugs #
Please file feature requests and bugs at the issue tracker.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.