Using web sockets to mange session for Sabre REST API
This is an experimental idea of handling the session using web sockets as a real time communication medium to the server.
- clone the repo or downloaded
- run
composer install
- run
php bin/Server.php
open the site in your browser.
database table is similar to this
CREATE TABLE `session` (
`session_id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`session_token` text NOT NULL,
`expire_in` int(11) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB D
You can use this query to create a view
CREATE VIEW as
SELECT
`session_id` AS `session_id`,
`session_token` AS `session_token`,
`expire_in` AS `expire_in`,
`created_at` AS `created_at`
FROM
`session`
WHERE
(DATEDIFF(SYSDATE(), created_at) < 7 )