1、首先在program中注册session服务 2、在program中使用session中间件 3、向session中存值 4、取session中的值 5、在core mvc视图中调用session 以上就是在.net core6.0中session的基本用法。