Session NoDB Store

    Example

    1. import (
    2. "github.com/lunny/tango"
    3. "github.com/tango-contrib/session"
    4. "github.com/tango-contrib/session-nodb"
    5. )
    6. type SessionAction struct {
    7. }
    8. func (a *SessionAction) Get() string {
    9. a.Session.Set("test", "1")
    10. return a.Session.Get("test").(string)
    11. }
    12. store, _ := nodbstore.New(nodbstore.Options{
    13. Path: "./nodbstore",
    14. DbIndex: 0,
    15. MaxAge: 30 * time.Minute,
    16. })
    17. o.Use(session.New(session.Options{
    18. Store: store,
    19. }))
    20. }