Skip to content
Jason Munro edited this page Aug 1, 2017 · 6 revisions

Summary

Cypht supports 3 different session stores out of the box. You can also create your own with the site module set. Remember that after making any changes to your hm3.ini file, you must rerun the scripts/config_gen.php script to update your site configuration.

PHP

Standard PHP sessions. This is the default, and is configured in the hm3.ini file by setting session_type to PHP

DB

Database based sessions using a configured PDO compatible database. To use database sessions, you will need to change the session_type values in your hm3.ini file to DB, configure the database in the same file, and create the session table. To configure the database to store sessions, set the following hm3.ini settings for your environment:

Connection type. Can be "host" to connect to a hostname, or "socket" to connect to a unix socket.

db_connection_type=host

Database host name or ip address. If db_connection_type is set to "socket", this value is ignored

db_host=127.0.0.1

If db_connection_type is set to "socket", this should be the filesystem location of the unix socket file. If db_connection_type is set to "host" this value is ignored.

db_socket=/var/lib/mysqld/mysqld.sock

Name of the database with the required tables

db_name=test

User to connect to the database with

db_user=test

Password to connect to the database with

db_pass=123456

Database type. can be any supported PDO driver ; (http://php.net/manual/en/pdo.drivers.php)

db_driver=mysql

Then create the required table to hold sessions. Mysql/Sqlite and Postgresql examples can be found in the hm3.sample.ini (https://github.com/jasonmunro/cypht/blob/master/hm3.sample.ini) file. Here is the Mysql table definition:

CREATE TABLE hm_user_session (hm_id varchar(250), data longblob, date timestamp, primary key (hm_id));

MEM

custom