gsession.go 636 B

1234567891011121314151617181920212223
  1. // Copyright 2019 gf Author(https://github.com/gogf/gf). 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. // Package gsession implements manager and storage features for sessions.
  7. package gsession
  8. import (
  9. "errors"
  10. "github.com/gogf/gf/util/guid"
  11. )
  12. var (
  13. ErrorDisabled = errors.New("this feature is disabled in this storage")
  14. )
  15. // NewSessionId creates and returns a new and unique session id string,
  16. // which is in 36 bytes.
  17. func NewSessionId() string {
  18. return guid.S()
  19. }