Giter Club home page Giter Club logo

php-mysql-session-handler's People

Contributors

a2nt avatar acki avatar sprain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-mysql-session-handler's Issues

CREATE SQL statement optimization

You can reduce the recommended DB table setup (at README.md):

CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(32) NOT NULL,
  `timestamp` int(10) unsigned DEFAULT NULL,
  `data` mediumtext,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Please specify the LICENSE for this code

I'd like to use your class in my project, but you haven't specified a proper license for your work, which means it automatically gets copyrighted and no one can use it without your explicit permission.

If your intent is to make this class usable, please insert a license, either as a LICENSE file in this repo, or in the header comment of your main class, so other people may use it as they wish.

(Good examples of free software licenses are GPL, MIT, BSD, Apache License, WTFPL, MPL)

Error when calling the setDbData() function

I found the mistake in the SessionHandler.php file. On line 34 you name the function "setDbDetails" but in the expample.php file you call the function "setDbData". I realy like this class. I looked along time for something and your class is the first working i found. It's very good. Thanks

PerdiscoVideo

Performance optimizations

I have few questions about performance.

Why do you use REPLACE INTO instead of INSERT ON DUPLICATE KEY UPDATE. When you're only creating new sessions this maybe makes sense. But most of the time you're gonna update sessions. For a small amount of sessions the difference is barely seen, but for a anything bigger this would stress the database for no reason with deleting the record before inserting when you only want to update the column/columns.

Second questions is why do you delete older sessions in open method instead of relying on php session garbage collect? Your solution forces a delete in every user interaction for every user. GC would reduce the amount queries and the more users application has the bigger the advantage of gc would be.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.