Simple Session Support

INTRODUCTION

Simple Session Support adds support for the PHP session to a site.  The session is created at initialization and destroyed at login or logout.   For details on how it works see my post Using Sessions in WordPress.  Feel free to borrow this code for use in your own plugins and themes.

INSTALLATION

Install from the WordPress  Plugins – Add New menu in wp-admin.

Activate the plugin.

More details, change history and download may be found at the WordPress Plugin Directory .

USING THE SESSION

The PHP session is an superglobal array named $_SESSION.  See the PHP Manual – Sessions for details on its use.

To save some data into the session

$_SESSION['myKey'] = "Some data I need later";

And to get that data out at a later time

if(isset($_SESSION['myKey'])) {
    $value = $_SESSION['myKey'];
} else {
    $value = '';
}

CONFIGURATION

There is no configuration required.

ADDITIONAL FEATURES

There are no additional features supported by Simple Session Support.  The code is simple, small and well documented, so you can use it as a starting point for your own plugin.

SUPPORT

This plugin has been tested against WordPress 3.8.

For support please Contact Devondev.

Thank you for your interest.

Comments

  1. hey
    very nice plugin :), and I’m using it for some time
    I use it to handle language (German/English). I have recently upgraded to the new version, and since then my language handling doesn’t work anymore. I wouldn’t know why.
    Could provide a link to the “old” version?
    Anyhow, very nice work!
    Cheers

Leave a Reply

Commenting Policy - Please Read Before Commenting

All comments are moderated so don't bother to spam the comments. Comments that are not related to the post will be deleted. Others may be edited to remove spam. Approved comments may provide a rel="dofollow" link to your website at our discretion. All other links will be rel="nofollow".

Thank you.

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>