Generate random float numbers

Package: Generate random float numbers Summary: Generate random floating point numbers Groups: Math, PHP 5 Author: Ovunc Tukenmez Description: This is a very simple class that can be used to generate random floating point numbers. It can gene...

PHP Session Management - Part 1 Print E-mail
User Rating: / 2
PoorBest 
Scope : PHP4
PHP Functions Used : session_start() and session_register()

PHP4 introduce built-in session management techniques. Session management is important feature to track variables associated with a user's web session which is a time that a user spends on site using the same browser. One thing notable is that if browser get closed due to any reason or user closed it, the session will no longer exists. PHP tracks sessions by placing a cookie on the user's browser which is not a foolproof method because some users, for security reasons, set their browsers not to accept cookies. In that case, session cannot be tracked using cookie. Otherwise, the cookie reference a session ID, which can be viewed in scripts by calling the $PHPSESSID variable.

In other method, PHP alters links on web pages so that they includes the $PHPSESSID variable. The problem with this method is that links appears unfriendly to visitors and search engines spiders. The main issues comes in SEO technique because everytime search engine bot get's a  new link due to included $PHPSESSID.

Starting a session uses the session_start() function which takes no argument:
session_start();

You need to include this function on each page before putting any print or output function.
This fuction has to be included on all pages on which you want to track sessions.
It will initialize a new session and creates the necessary temp files to track the session. If it found $PHPSESSID in a cookie or through link method the it will resume the available session and assign the all registered variables to it. You need to register variables using the session_register() function:
session_register(STRING);

Once you have started the session and registered one or more variables, you can use those variables across any session enabled pages on your site.

We will discuss Variable Types and Tracking Variables across web pages during a session, in our next part.
 
< Prev   Next >