Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Session ID's can be faked, there is no doubt about it. All one has to do is change the value in the cookie (if using cookies) or the parameter value. It really is a no brainer to fake.
Now the good news. What is not so easy to do is to determine how the session id is created. Depending on the level of security you want, you may have the session id changed every time a user views a page, or change it for every session. To do my session stuff, i use MD5 and a combination of various things including an arbitrary string, with the session id lasting as long as a session (a user is logged in). I dont really need the security to change the session id each time a page is viewed. Each time a logs in you give them a session key, either in a cookie, or html parameter somewhere, then and save it server side in a database against the user_[id|name]. You have the overhead of making a call to the database each time, however there are many things that can be done to tune this access, depending on the level of performance you require, ie caching the db in memory, using placeholders in you DBI (if you're using DBI), using mod_perl to create persistant connections (again, if you're using DBI) etc etc. In reply to Re: Session handling security
by Ryszard
|
|