Plugin Directory

Changeset 1362596


Ignore:
Timestamp:
03/02/2016 01:22:10 PM (10 years ago)
Author:
dgledson
Message:

modificado tratamento de sessoes do plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • webcourier/trunk/webcourier.php

    r1362585 r1362596  
    11<?php
    2 session_start();
     2
    33/*
    44  Plugin Name: Webcourier Plugin
     
    1717    exit; // Exit if accessed directly
    1818}
     19
     20add_action('init', 'myStartSession', 1);
     21add_action('wp_logout', 'myEndSession');
     22add_action('wp_login', 'myEndSession');
     23
     24function myStartSession() {
     25    if(!session_id()) {
     26        session_start();
     27    }
     28}
     29
     30function myEndSession() {
     31    session_destroy ();
     32}
     33
    1934//path to autoloader
    2035define('WEBCOURIER_PLUGIN_DIR', dirname(__FILE__) . '/');
Note: See TracChangeset for help on using the changeset viewer.