Skip to content

Commit c272de4

Browse files
committed
Fix error when saving new permission #78
1 parent 64e3038 commit c272de4

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

datatable.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ DROP TABLE IF EXISTS `permissions`;
7575
CREATE TABLE `permissions` (
7676
`id` int NOT NULL AUTO_INCREMENT,
7777
`structure_uuid` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
78-
`type` enum('admin','interface') COLLATE utf8mb4_unicode_ci NOT NULL,
78+
`type` enum('admin','structure') COLLATE utf8mb4_unicode_ci NOT NULL,
7979
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
8080
PRIMARY KEY (`id`)
8181
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

index.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 30);
4+
session_set_cookie_params(60 * 60 * 24 * 30);
35
session_start();
46

57
error_reporting(E_ALL);
@@ -26,14 +28,6 @@
2628
header("Access-Control-Allow-Credentials: true");
2729
header('Content-Type: application/json');
2830

29-
setcookie("PHPSESSID", session_id(), [
30-
'expires' => time() + 60 * 60 * 24 * 30,
31-
'path' => '/',
32-
'domain' => '.' . $_SERVER['HTTP_HOST'],
33-
'secure' => isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https',
34-
'samesite' => 'None'
35-
]);
36-
3731
// Respond with a 200 OK status for preflight requests
3832
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
3933
http_response_code(200);

0 commit comments

Comments
 (0)