github.com/gogf/gf@v1.16.9/os/gsession/gsession.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  // Package gsession implements manager and storage features for sessions.
     8  package gsession
     9  
    10  import (
    11  	"github.com/gogf/gf/errors/gcode"
    12  	"github.com/gogf/gf/errors/gerror"
    13  	"github.com/gogf/gf/util/guid"
    14  )
    15  
    16  var (
    17  	ErrorDisabled = gerror.NewOption(gerror.Option{
    18  		Text: "this feature is disabled in this storage",
    19  		Code: gcode.CodeNotSupported,
    20  	})
    21  )
    22  
    23  // NewSessionId creates and returns a new and unique session id string,
    24  // which is in 36 bytes.
    25  func NewSessionId() string {
    26  	return guid.S()
    27  }