Beefy Boxes and Bandwidth Generously Provided by pair Networks
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
in thread Session handling security by Fingo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-03-28 10:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found