Static fields vs Session variables

前端 未结 4 2156
花落未央
花落未央 2020-12-05 02:24

So far I\'ve been using Session to pass some variables from one page to another. For instance user role. When a user logs in to the web application the role id of the user i

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 03:00

    You forget one thing (I think)

    Static data will be the same for all users of the application, while session is "per user".

    So for your "User Role" scenario, I would expect funny results ;)

提交回复
热议问题