News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
PHP Sessions
November 17, 2011 @ 10:19:08

On PHPMaster.com today there's a new introductory tutorial for those trying to figure out sessions in PHP. Sessions can be one of the most powerful tools at your disposal and handling them correctly can sometimes be a little tricky.

$_SESSION is a special array used to store information across the page requests a user makes during his visit to your website or web application. The most fundamental way to explain what a sessions is like is to imagine the following scenario: You are working with an application. You open it, make some changes, and then you close it. That is a session in it's simplest form.

They start with a basic "how to use them" example of setting a username value to the current session and pulling the value back out. They also show the use of the session_unset and session_destroy methods for ending the session. Some security tips are mentioned too - timeouts, regenerating the session ID, destroying them correctly and using a more permanent storage option (by default, they store on the local disk).

0 comments voice your opinion now!
session tutorial introduction security destroy timeout


blog comments powered by Disqus

Similar Posts

DZone.com: Refactoring away from spaghetti PHP

Sebastian Bergmann's Blog: Getting Started with Hamcrest

SitePoint Web Foundations Blog: Quick Tip: Install Zend Server 7 on an Ubuntu 14.04 Vagrant Box

Zend Developer Zone: Building Websites with Joomla! 1.5

Dave Marshall's Blog: Landing a PHP job Part 1: Technical Knowledge and Skills


Community Events





Don't see your event here?
Let us know!


zendserver framework code community tips threedevsandamaybe interview series podcast conference release developer language introduction api deployment list development symfony laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework