is it a good idea to create an enum for the key names of session values?

后端 未结 7 2408
失恋的感觉
失恋的感觉 2021-02-14 22:45

instead of doing

 session(\"myvar1\") = something
 session(\"myvar2\") = something
 session(\"myvar3\") = something
 session(\"myvar4\") = something
7条回答
  •  迷失自我
    2021-02-14 23:06

    I realize this question was asked a while ago and an "answer" has already been picked. But I just came across it. Martin's answer is good. However, to assist anyone who stumbles across this in the future, if you really want a slick way to deal with Session, read this post. I don't think you'll find anything easier.

提交回复
热议问题