类 SaRawSessionUtil

java.lang.Object
cn.dev33.satoken.session.raw.SaRawSessionUtil

public class SaRawSessionUtil extends Object
SaSession 读写工具类
从以下版本开始:
1.42.0
作者:
click33
  • 方法详细资料

    • splicingSessionKey

      public static String splicingSessionKey(String type, Object valueId)
      拼接Key: 在存储 SaSession 时应该使用的 key
      参数:
      type - 类型
      valueId - 唯一标识
      返回:
      sessionId
    • isExists

      public static boolean isExists(String type, Object valueId)
      判断:指定 SaSession 是否存在
      参数:
      type - /
      valueId - /
      返回:
      是否存在
    • getSessionById

      public static SaSession getSessionById(String type, Object valueId, boolean isCreate)
      获取指定 SaSession 对象, 如果此 SaSession 尚未在 Cache 创建,isCreate 参数代表是否则新建并返回
      参数:
      type - /
      valueId - /
      isCreate - 如果此 SaSession 尚未在 DB 创建,是否新建并返回
      返回:
      SaSession 对象
    • getSessionById

      public static SaSession getSessionById(String type, Object valueId)
      获取指定 SaSession, 如果此 SaSession 尚未在 DB 创建,则新建并返回
      参数:
      type - /
      valueId - /
      返回:
      SaSession 对象
    • deleteSessionById

      public static void deleteSessionById(String type, Object valueId)
      删除指定 SaSession
      参数:
      type - /
      valueId - /