Sir Lojik
Sir Lojik

Reputation: 1429

secure php session handling that uses mysql storage

I’m trying to find a lightweight PHP session handling library, i’ve googled and fallen into confusion.

  1. I want a library that stores sessions using MySQL
  2. allows kicking out of logged in user
  3. does ip matching
  4. browser matching
  5. secure to session hacking etc.

Any ideas?

Upvotes: 1

Views: 2965

Answers (3)

Carlos Arturo Alaniz
Carlos Arturo Alaniz

Reputation: 428

You may want to check out this class that I made a while ago... it does everything that you say expect for kick a user out, but you can mae a function that does that in 5 minutes (just call the delete method with the user id that you want to kick out).

It still needs documentation and some tweeks here and there, but you can give yourself an idea of how is done.

I wouldn't relay on user's IP for security, if they're using rotating IP (some cellphones companies) or they're behind thor or something you're going to have issues, use user_agent instead.

Upvotes: 0

afaf12
afaf12

Reputation: 5426

You could have a look at this article by Chris Shiflett, which describes making changes to session_set_save_handler().

Upvotes: 1

Mikhail
Mikhail

Reputation: 9007

If you're familiar with MySQL and PHP it's rather trivial to write your own session handler.

http://php.net/manual/en/function.session-set-save-handler.php

It may be faster to write a personalized one than searching for exactly what you want.

Upvotes: 1

Related Questions