elieli/nonProfit — pull request #1 by statichippo (2012-03-18 21:31:07+00:00)
Title: fix immediate issue of shared login on homepage

there is so much wrong with this code but i don't have the week free it would take to rewrite it! i've dealt with the immediate issue of the nonProfitHome.aspx showing the logged in user across multiple computers. you were storing the current user in Application data (which is shared state) instead of Session data.

There are a number of other problems that I didn't touch on:
1) Even though Session works, it's is not the best idea to store all this data in the session.
2) You have a lot of repetitive code (return Application["cust"]) and so even though i changed it in these places i did not change it anywhere else. You should consolidate this into a helper class at least so you can fix things in one place!
3) The way you're doing authentication and storing all this data in the user session is not going to scale and is not particularly secure
4) i noticed that you're polling simplepage.aspx every second which, as i mentioned, in and of itself is fine. but you should be returning pure JSON, not an HTML page and the javascript around this is a mess (i didn't touch it)