WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : base64 with encryption - encode and decode sessions
Categories : PHP, PHP Classes, Encryption, Sessions Click here to Update Your Picture
Robert amigura
Date : May 09th 2007
Grade : 5 of 5 (graded 2 times)
Viewed : 2762
File : 4633.zip
Images : Image 1 , Image 2
Search : More code by Robert amigura
Action : Grade This Code Example
Tools : My Examples List

 
Like this code?
Show the author your appreciation.
Submit your own code examples 
 

This is a php class that can be used to encode and decode session values to make it harder to obtain private session values for people with access to session data.

It uses base64 encoding and mcrypt_encrypt encryption to set the values of one or more session variables values.

It can be easley modified to work with other varibles.

<?php
/*
base64 with encryption - base64 encode and decode sessions

author:  Amigura
website: LINK1http://www.amigura.co.uk/LINK1
*/

session_start();
include
'enc64_session.php';

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

// sessions to set and value
$set_ses = array('value1'=> 9,'value2'=> 34);

// 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

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

?>



A beginner's session handling class
Categories : PHP, PHP Classes, Sessions, Beginner Guides
SPL and ITERATOR : examples
Categories : PHP, Object Oriented, PHP Classes, Sessions
Scramble Eggs - php class to scramble/encode
Categories : PHP, PHP Classes, Security, Encryption
Optimized Online users class
Categories : PHP, PHP Classes, Sessions
Email Class
Categories : PHP, Mail, PHP Classes
Customizable Calendar Class
Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar
Simple class that uses GD to draw pie charts. After the class definition there's some sample code to demonstrate how you use the class.
Categories : Graphics, PHP, PHP Classes, GD image library, Charts and Graphs
PHP4 DirectoryIterator Class
Categories : PHP, PHP Classes, Filesystem, Directories
Class to build a select tag in html, useful to build select boxes from a data base
Categories : PHP, HTML and PHP, PHP Classes
[PHP5] aDB PDO LIKE Database Abstraction. Switch easily from one db server to another, strong errors management, manage transactions, queries preparation and more.
Categories : PHP, PHP Classes, Databases, MS SQL Server, MySQL
Cool guestbook
Categories : PHP, Complete Programs, PHP Classes
PHP4 session helper HTML file.
Categories : PHP, Java Script, HTML and PHP, Sessions
[PHP5] NOTIMEOUT PACKAGE
Categories : PHP, PHP Classes, AJAX
MySQL Connection/Query Class
Categories : Databases, MySQL, PHP, PHP Classes
Php Input Output Library - access the parallel and serial(rs232) port directly.
Categories : PHP, Hardware, PHP Classes