Skip to content


October 30, 2013
  1. A PHP session variable is used to store information about, or change settings for a user session
  2. Cookies are a mechanism for storing data in the remote browser and thus tracking or identifying return users
  3. A variable is a holder for a type of data. So, based on its type, a variable can hold numbers, strings, booleans, objects, resources or it can be NULL.

must always be declared when accessing anything about session


initializes the value of the session

$_SESSION[‘nameSession’] = ‘value’;

desplays the value in the session

echo $_SESSION[‘nameSession’];

deletes all sessions 


another way to destroy sessions is

$_SESSION = array();


set a cookie 

setcookie(‘nameCookie’, ‘value’, time() + (60*60*60*7));

displays the value of the cookie

echo $_COOKIE[‘nameCookie’];


set the value

$varName = ‘value’;

the variable exists in the whole document

Global $varGlobalName;

$varGlobalName = ‘value’;


From → Discussion, PHP

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Children's Book Reviews

Malav Shah

official Web Site

My Road to Programming

The journey of how I taught myself to program.


Look at what's brewing up guys! we all are work in progress. So don't meander, lets micromesh everything and have candid conversation about every problem related to C, C++ and JAVA. We can rejuvenate the crinkled faces.


A simple guide to programming...


Information Techonology

Rahul's Work

My Work Tips and Tutorial on Various Tech.

Turnip Farmers

Kingdom Scans


Technology news, trends and analysis covering mobile, big data, cloud, science, energy and media

The Neighborhood

is under renovation in preparation for our 6th Season


News About Tech, Money and Innovation


The Diary of a Retiree

50 Year Project

My challenge to visit 192 countries, read 1,001 books, and watch the top 100 movies

[BTW] : Ben Trube, Writer

Writer, Programmer, Singer

My Arch Walkthrough

Arch linux made easy

Don Charisma

because anything is possible with Charisma

SutoCom Solutions

Success & Satisfaction with the Cloud

%d bloggers like this: