phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Zend Framework Session: Accessing Session Data

Tag: framework, zend, zend framework, session   Category: PHP Framework
post: 23 Apr 2008 read: 431


Zend Framework Session Step By Step Tutorial - Part 3: In this post, we learn how to access session data. Now, we talk about how to access the session.

Please, give attention a code at previous post:


$ns = new Zend_Session_Namespace('HelloWorld');
    
if(!isset($ns->yourLoginRequest)){
  $ns->yourLoginRequest = 1;
}else{
  $ns->yourLoginRequest++;
}

From above, we know how to set session at Zend framework. Just give properties such as:


$ns->yourLoginRequest = 1;
$ns->thisIsSession = "Oke";
$ns->nameOfSession = "MySession";
$ns->foo = 10;

Now, how to access the values? Just simple:


echo $ns->yourLoginRequest;
echo $ns->thisIsSession;
echo $ns->nameOfSession;
echo $ns->foo;


Series this article:
Zend Framework Session: Introduction
Zend Framework Session: Using Namespace
Zend Framework Session: Accessing Session Data
Zend Framework Session: Seing All Values at Namespace
Zend Framework Session: Locking and Unlocking Namespace
Zend Framework Session: Automatic Expiration

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
CAPTCHA - part 3 : "Are you human or ....?" (Build Your CAPTCHA)
Email: Send Attachement Mail

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting