Location: PHPKode > scripts > Encoding Sessions > encoding-sessions/example2.txt
<?php
/* 
base64 with encryption - encode and decode sessions

author:  Amigura
website: http://www.amigura.co.uk/
*/ 
session_start();
include 'enc64_session.php';

// call class
$encode_it = new encode_session;
// output class 


$name = 'Amigura';
$prog = 'Encoding Sessions';


// sessions to set and value - 'session name'=> session value
// you can have as many sessions as you want
$set_ses = array('value1'=> $name,'value2'=> $prog);

// encoded session
echo '<br>encoded session<br>';
$encode_it->encode($set_ses,$ky);
echo $encode_it->$enc_val; 



// decoded session individual key
$get_ses = 'value1'; // session key name 1

echo '<br>decoded session<br>';
$encode_it->decode($get_ses,$ky);
echo 'Author name: '. $encode_it->$dec_val ; 

echo '<br>';

$get_ses = 'value2'; // session key name 2
$encode_it->decode($get_ses,$ky);
echo 'Program name: '. $encode_it->$dec_val; 

?>
Return current item: Encoding Sessions