everyone. I am currently working in a .net mvc3 project team. Today ,my team leader told me to use a custom catch (implemented by him) instead of session .I saw the usage of both are nearly the same. ( I can’t see his source code 🙂
Session["somekey"] = somevalue, somevar = Session["somekey"]
&
CustomCatch["somekey"] = somevalue, somevar = CustomCatch["somekey"].
I want to ask what’s the advantage my team leader want me to use his custom catch instead of session? Or he just want me to do the “extra” work?
I have to say the truth. I consider the
Sessionobject to be one of the big evils (withdouble/float,Regexes that don’t consider internationalization and diacritics (àèéìòù for example),Regexes in general, blocks of code that don’t consider internationalization (àèéìòù, date and numeric formats) and some other ones).You can use it to store the profile of the current user. You can user it to store the settings of the current user. Full stop. Everything else is bad bad bad.
This is because if your user does ctrl-n on a page, the new window that opens uses the same
Session. Now begin thinking what could happen.Perhaps what your Team Leader did solve this problem.