Miscellaneous
  Home arrow Miscellaneous arrow Using Sessions in PHP
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Forums Sitemap 
Dedicated Servers  
Download TestComplete 
JMSL Numerical Library 
IBM® developerWorks
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

Using Sessions in PHP
By: Hermawan Haryanto
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 12
    2002-11-21

    Table of Contents:
  • Using Sessions in PHP
  • Basic Sessions
  • Running Membership with Sessions
  • Another Example
  • Conclusions

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using Sessions in PHP


    (Page 1 of 5 )

    Join Hermawan in learning how to use sessions in PHP.

    Building web applications with membership management is one of the most frequent tasks that every programmer does. Managing membership data, such as username, password and the member's profile with sessions in PHP is the easiest and simplest solution, although it is not the only one.

    Preparation

    With this tutorial, I assume you are using PHP 4.1.0 or the later. The first thing that we should know to use sessions is that you have to initialize the session.

    session_start();

    Any script which has that line would make the script available to register a new session or read an existing session which we’ve defined on another page.

    Enough of the blah blah stuff, shall we now go to the example stuff?

    More Miscellaneous Articles
    More By Hermawan Haryanto


       · Thank you Hermawan for a great Sessions tutorial. When I first started using...
       · I cant get this to work.. if i put in my username and password it just clears the...
       · This will be very useful to me. With slight modification, I think I can secure my...
       · Horasss SnowStorm...!!!Might be you have REGISTER GLOBAL problems. check your...
       · In step 2 of the 'Another Example' part there is a link to dbal to download. However...
       · Your web host may not allow you to connect to your session save path. Try using...
       · In login.php, the line:Header("Location: ./index.php").....
       · How to count all the sessions created for a site?
       · Check the form properties
       · If only I saw your message earlier...Anyway, for a beginner who just tried out...
       · i have most of it working by using output buffers. But in the login.php you...
       · Thanks alot for this article. I can now move ahead with my project.
     

    MISCELLANEOUS ARTICLES

    - Stopping CSRF Attacks in Your PHP Applicatio...
    - Quick and Dirty AJAX Tutorial
    - Flickr Puzzle Mashup
    - The PAVISE of Security
    - Creating a CAPTCHA with PHP
    - Sending SMS Thru HTTP
    - The Postal Fix - Part 2
    - Adding Mail with Exim
    - The Postal Fix - Part 1
    - Create Your Own Custom API
    - Adding Drop Shadows with PHP
    - Writing a Basic Authentication System in PHP
    - Overlapping Images with GD
    - Using Sockets in PHP
    - Dynamic CSS with PHP






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway