Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Session handling security

by Ryszard (Priest)
on Aug 21, 2002 at 07:25 UTC ( [id://191666]=note: print w/replies, xml ) Need Help??


in reply to Session handling security

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://191666]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found