File tree 3 files changed +27
-0
lines changed
3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 24
24
<script src="plugins/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
25
25
<script src="plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
26
26
<script src="plugins/clipboardjs/clipboard.min.js"></script>
27
+ <script src="js/keepalive.js"></script>
27
28
28
29
<!-- AdminLTE App -->
29
30
<script src="dist/js/adminlte.min.js"></script>
Original file line number Diff line number Diff line change
1
+ // Keep PHP sessions alive
2
+ // Sends requests to keepalive.php in the background every 10 mins to prevent PHP garbage collection ending sessions
3
+
4
+ function keep_alive ( ) {
5
+
6
+ //Send a GET request to keepalive.php as keepalive.php?keepalive
7
+ jQuery . get (
8
+ "keepalive.php" ,
9
+ { keepalive : 'true' } ,
10
+ function ( data ) {
11
+ // Don't care about a response
12
+ }
13
+ ) ;
14
+
15
+ }
16
+
17
+ // Run every 10 mins
18
+ setInterval ( keep_alive , 600000 ) ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ // Keep PHP sessions alive
4
+ // Receives requests via AJAX in the background every 10 mins to prevent PHP garbage collection ending sessions
5
+ // See footer.php & js/keepalive.js
6
+
7
+ session_start ();
8
+ session_write_close ();
You can’t perform that action at this time.
0 commit comments