PluginProbe ʕ •ᴥ•ʔ
NinjaFirewall (WP Edition) – Advanced Security Plugin and Firewall / trunk
NinjaFirewall (WP Edition) – Advanced Security Plugin and Firewall vtrunk
4.8.7 4.8.6 trunk 4.5 4.5.1 4.5.10 4.5.11 4.5.2 4.5.3 4.5.4 4.5.5 4.5.6 4.5.7 4.5.8 4.5.9 4.6 4.6.1 4.7 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.8 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5
ninjafirewall / lib / class-php-session.php
ninjafirewall / lib Last commit date
share 8 years ago .htaccess 11 years ago anti_malware.php 4 years ago class-coupon.php 5 months ago class-email-sodium.php 5 days ago class-firewall-log.php 2 days ago class-helpers.php 7 months ago class-import-export.php 2 months ago class-ip.php 3 months ago class-nfw-database.php 5 months ago class-nfw-session.php 7 months ago class-php-session.php 1 year ago class_mail.php 5 days ago event_updates.php 9 months ago firewall.php 3 months ago fw_centlog.php 3 months ago fw_fileguard.php 3 months ago fw_livelog.php 1 year ago help.php 5 days ago helpers.php 3 weeks ago i18n-extra.php 5 days ago i18n.php 1 year ago index.html 13 years ago init_update.php 1 year ago install.php 1 year ago install_default.php 5 months ago loader.php 5 months ago mail_template_firewall.php 1 year ago mail_template_plugin.php 3 weeks ago scheduled_tasks.php 3 years ago settings_dashboard.php 3 weeks ago settings_dashboard_about.php 5 days ago settings_dashboard_statistics.php 3 weeks ago settings_event_notifications.php 3 weeks ago settings_events.php 3 weeks ago settings_firewall_options.php 3 weeks ago settings_firewall_policies.php 3 weeks ago settings_login_protection.php 3 weeks ago settings_logs.php 3 weeks ago settings_logs_firewall_log.php 5 days ago settings_logs_live_log.php 3 weeks ago settings_monitoring.php 5 days ago settings_monitoring_file_check.php 3 weeks ago settings_monitoring_file_guard.php 3 weeks ago settings_network.php 3 weeks ago settings_security_rules.php 3 weeks ago settings_security_rules_editor.php 3 weeks ago settings_security_rules_update.php 3 weeks ago sign.pub 7 years ago thickbox.php 4 years ago widget.php 3 years ago wpplus.php 2 months ago
class-php-session.php
93 lines
1 <?php
2 /*
3 +=====================================================================+
4 | _ _ _ _ _____ _ _ _ |
5 | | \ | (_)_ __ (_) __ _| ___(_)_ __ _____ ____ _| | | |
6 | | \| | | '_ \ | |/ _` | |_ | | '__/ _ \ \ /\ / / _` | | | |
7 | | |\ | | | | || | (_| | _| | | | | __/\ V V / (_| | | | |
8 | |_| \_|_|_| |_|/ |\__,_|_| |_|_| \___| \_/\_/ \__,_|_|_| |
9 | |__/ |
10 | (c) NinTechNet Limited ~ https://nintechnet.com/ |
11 +=====================================================================+
12 */
13
14 if ( class_exists('NinjaFirewall_session') ) {
15 return;
16 }
17
18 class NinjaFirewall_session {
19
20
21 /**
22 * Start a PHP session.
23 */
24 public static function start() {
25 /**
26 * Make sure no header was sent already, no session exists
27 * and that sessions are enabled.
28 */
29 if ( headers_sent() || session_status() !== PHP_SESSION_NONE ) {
30 return false;
31 }
32 return session_start();
33 }
34
35
36 /**
37 * Read session data.
38 */
39 public static function read( $key ) {
40
41 if ( isset( $_SESSION[ $key ] ) ) {
42 return $_SESSION[ $key ];
43 }
44 return null;
45 }
46
47
48 /**
49 * Write session data.
50 */
51 public static function write( $data = [] ) {
52
53 foreach( $data as $key => $value ) {
54 $_SESSION[ $key ] = $value;
55 }
56 }
57
58
59 /**
60 * Unset a key or the whole session array.
61 */
62 public static function delete( $key = '') {
63
64 if ( $key ) {
65 unset ( $_SESSION[ $key ] );
66 } else {
67 $_SESSION = [];
68 }
69 }
70
71
72 /**
73 * Write session data and end session.
74 */
75 public static function close() {
76
77 return session_write_close();
78 }
79
80
81 /**
82 * Return the session name.
83 */
84 public static function name() {
85
86 return ini_get('session.name');
87 }
88
89 }
90
91 // =====================================================================
92 // EOF
93