Your EE module, plugin, and extension marketplace!

Our Newsletter


Click to enlarge

Session Variables Plugin

RRP:
Price:
$0.00
Vendor:
PutYourLightsOn
Brand:
Weight:
Rating:
()
Availability:
Shipping:
Gift Wrapping:

Quantity:


Product Description

 

This is an Expression Engine plugin that allows you to store variables in PHP's native session.

* Current Version: 1.0 (released 7 April 2008)
* Works with ExpressionEngine 1.6 and higher.


Concept

Sometimes you may want to temporarily store a variable for a short amount of time without writing a value to the database. Expression Engine's sessions do not allow this, however PHP's native sessions do.

This plugin allows you to use PHP's native session variables.

Find out more about PHP Sessions.


How It Works

The session variables plugin works by using PHP's native session to store variables on the server. The variables can easily be set, retrieved and deleted.

Here are some examples of how to use it:

// setting the language variable to french

{exp:session_variables:set name="language" value="french"}  
	
// setting the language variable to the second segment

{exp:session_variables:set name="language" value="{segment_2}"}  
	
// setting the language variable to the posted variable

{exp:session_variables:set name="language" value="POSTED_VARIABLE"}  
	
// getting the language variable

You are currently viewing this page in {exp:session_variables:get name="language"}  
	
// deleting the language variable

{exp:session_variables:delete name="language"}  
	

When using the set function, the name parameter and value parameter are required.

POSTED_VARIABLE is a constant that specifies the value of the posted variable with the specified name (in the example above it would refer to $_POST['language']).

When using the get function, only the name parameter is required.

When using the delete function, only the name parameter is required.

Note: The lifetime of the session is set in the php.ini file (session.gc_maxlifetime) and is 1440 seconds by default. It can be changed using the ini_set function, however it can be reset in unpredictable ways. This article explains how and why.


Installation

  1. Download and unzip session_variables.zip
  2. Upload pi.session_variables.php to the system/plugins folder.

 


Find Similar Products by Category

Write your own product review

Product Reviews

This product hasn't received any reviews yet. Be the first to review this product!

Add to Wish List

Click the button below to add the Session Variables Plugin to your wish list.

You Recently Viewed...




Clicky Web Analytics