Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

CGI::Session, method to stop account sharing

by Anonymous Monk
on Apr 13, 2011 at 16:50 UTC ( [id://899237]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm using CGI::Session with the memcached driver. I'm wondering if there is an accepted method to prevent the sharing of accounts (username/password). Thank you.
  • Comment on CGI::Session, method to stop account sharing

Replies are listed 'Best First'.
Re: CGI::Session, method to stop account sharing
by SuicideJunkie (Vicar) on Apr 13, 2011 at 19:24 UTC

    What about simply having a hash mapping usernames to their most recent session ID?

    If the user is just logging on, update the hash. If the user is doing anything else, check to make sure that their current session matches the one in the hash.

      That's a good idea... but I must use memcached, as this code needs to run on a farm of webservers (each one pushing as much throughput as possible), with many memcached servers. This may be premature... but after reading the CGI::Session::Driver::memcached code, I believe, that in my case, it's unusable. It uses the sid as the key. This will fill up my 4G memcached space in no time. Since the sid is random, I won't have any practical method to age out sessions. I have already written my own driver to replace it. Thanks for your reply.
Re: CGI::Session, method to stop account sharing
by Anonymous Monk on Apr 13, 2011 at 17:05 UTC
    What do you mean?
      Stop duplicate simultaneous logins.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-20 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found