Download the PHP package crazy-max/cws-session without Composer

On this page you can find all versions of the php package crazy-max/cws-session. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cws-session

Latest Stable Version Minimum PHP Version Build Status Code Quality Become a sponsor Donate Paypal

:warning: Abandoned project

This project is not maintained anymore and is abandoned. Feel free to fork and make your own changes if needed.

Thanks to everyone for their valuable feedback and contributions.

CwsSession

PHP class to manipulate sessions. Data are securely encrypted and sessions are stored in database.

Installation

And download the code:

Getting started

Add a new table in your database with the following structure.
You can change the name of the table (sessions) but not the columns.

id - the session id.
id_user - the user id from your application. If you want to use it, use getParamUserId/setParamUserId methods.
expire - the session cache expire.
data - the session data.
skey - unique key for data encryption.

See tests/test.php file sample to help you.

Disconnect all users

If you want to disconnect all the users from your PHP application, execute this query :

Count visitors and users connected

If you want to count visitors and users connected on your PHP application, execute this query :

You have to use the setParamUserId method when the user is logged in.

Example

Methods

process - Start the process.
start - To call everytime you want to start a new session instead of session_start().
regenerate - Regenerates the session and delete the old one. It also generates a new encryption key in the database. To use each time a user connects to your application successfully.
update - Update specific session vars (user agent, IP address, fingerprint).
isActive - Check if the session is active or not.

getLifetime - The session life time.
setLifetime - Set the session life time (in seconds).
getCookieDomain - The domain of the session cookie.
setCookieDomain - Set the domain of the session cookie (eg: .foo.com).
getSessionName - The session name.
setSessionName - Set the session name. (default PHPSESSID).
isFpEnable - The fingerprint enable status.
setFpEnable - Enable/disable fingerprint.
getFpMode - The fingerprint mode.
setFpModeBasic - Set the fingerprint mode basic. (default)
setFpModeShield - Set the fingerprint mode shield.
getDbExt - The database PHP extension used to store sessions.
setDbExtMysql - Set the database PHP extension used to store sessions to mysql.
setDbExtMysqli - Set the database PHP extension used to store sessions to mysqli.
setDbExtPdo - Set the database PHP extension used to store sessions to pdo. (default)
getDbPdoDriver - The PDO driver to use. (if db extension is Pdo)
setDbPdoDriverFirebird - Set the PDO driver to firebird.
setDbPdoDriverMysql - Set the PDO driver to mysql. (default)
setDbPdoDriverOci - Set the PDO driver to oci.
setDbPdoDriverPgsql - Set the PDO driver to pgsql.
setDbPdoDriverSqlite - Set the PDO driver to sqlite.
setDbPdoDriverSqlite2 - Set the PDO driver to sqlite2.
setDbPdoDriverSqlsrv - Set the PDO driver to sqlsrv.
getDbHost - The database host name or IP address.
setDbHost - Set the database host name or IP address.
getDbPort - The database port.
setDbPort - Set the database port. Leave empty if your are not sure.
setDbUsername - Set the database username.
setDbPassword - Set the database password.
getDbName - The database name.
setDbName - Set the database name.
getDbCharset - The database charset.
setDbCharset - Set the database charset. Leave empty if your are not sure.
getDbTableName - The database table name to store sessions.
setDbTableName - Set the database table name to store sessions (default 'sessions').
getParamFp - The fingerprint SESSION value.
getParamUserId - The user id SESSION value.
getParamUa - The user agent SESSION value.
getParamIp - The ip address SESSION value.
getParam - A SESSION value by key. Use this method instead $_SESSION var.
setParamUserId - Set id_user SESSION value. A user id from your application.
setParam - Set a SESSION key/value. Use this method instead $_SESSION var.
getError - The last error.

How can I help ?

All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon: You can also support this project by becoming a sponsor on GitHub :clap: or by making a Paypal donation to ensure this journey continues indefinitely! :rocket:

Thanks again for your support, it is much appreciated! :pray:

License

MIT. See LICENSE for more details.


All versions of cws-session with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-pdo Version *
crazy-max/cws-debug Version ~1.11
crazy-max/cws-crypto Version ~1.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package crazy-max/cws-session contains the following files

Loading the files please wait ....