top

Package sessions contains middleware for easy session management in Martini.

 package main

 import (
   "github.com/go-martini/martini"
   "github.com/martini-contrib/sessions"
 )

 func main() {
	  m := martini.Classic()

	  store := sessions.NewCookieStore([]byte("secret123"))
	  m.Use(sessions.Sessions("my_session", store))

	  m.Get("/", func(session sessions.Session) string {
		  session.Set("hello", "world")
	  })
 }

Imports 6 package(s) ΒΆ

  1. github.com/boj/redistore
  2. github.com/dancannon/gorethink
  3. github.com/miquella/rethinkdb_session_store
  4. github.com/go-martini/martini
  5. github.com/gorilla/context
  6. github.com/gorilla/sessions