如何在js页面获取session

2025-02-28 00:37:20
推荐回答(1个)
回答1:

在jsp中使用js中的设置属性,进而获得session保存的属性值,实例如下:
session设置:
session.setAttribute("username",username);
session.setAttribute("password",password);
session获取:
username=session.getAttribute("username");
password=session.getAttribute("password");