Manual of PHP

 
 
 

Web map

 
rim   rim
Carriedarrow Meetings

 

Meetings To print E-mail

Generally a web consists of a series of pages between which some relation exists. A clear example is a page in which it is necessary to be registered to be able to gain access to them since according to the category of the user to we will allow to gain access to a few sections or others. In these applications it will be necessary to be verifying the user's permissions and for it we use an element in PHP named "meetings".

A meeting begins when a user enters the web application and finishes when the user leaves the application (further on we will understand that thing about "to leave application").

During all this time we can manipulate a series of variables that begin on having initiated the meeting and to support a type of common information between all the pages (in case of the registered user it would be the privileges that it possesses).

To support this constant information it is necessary that the information keeps in a file be already in the client (cookies) or in the servant (in case it has deactivated the cookies).


For the problem that consists of differing the different users there exists a very basic solution that consists of an identifier of different meeting in every case.

This meeting identifier must be sent from one page to other one to support the active meeting (unless in the configuration of the servant we have the option activated session_trans_id) and also it is necessary to spend the meeting identifier in the forms like a field HIDDEN.


Examples:

- Hypertie
<to href = "pagina.php? <? =SID?>"> to Enter </to>


- form
<unputt type = "hidden" yam = "session_name ()" "SID" values =>

Functions of management of meetings

function Meaning
session_start (); If it is the first request it generates a random identifier of meeting which name will be sess_IDsesión; if another continuous request is the meeting initiated previously.
session_destroy (); It eliminates all the information associated with a meeting, erases the file in the servant but it does not erase the cookie.
session_register (name); It receives like parameter a series of global names of variable and registers them like meeting variables in the file of the servant
session_unregister (name); We eliminate the introduced global variable and the content of this variable is eliminated in the file of the servant. Without spending the parameter name we will eliminate all the variables of the meeting.
session_is_registered (name); He is sick true in case in the meeting a variable is registered with the above mentioned name.
session_unset (); We stop without any value assigned to all the variables of the meeting
session_id ([name); If we do not provide any parameter to him it gives us the meeting identifier; if we provide the parameter to him name it changes the value of the identifier into the parameter name.
session_name ([name); If it is invoked without parameter he returns the name of the internal variable that the meetings id has; if parameter passes it changes the name of the meeting.
session_get_cookie_params (); It allows to define new values for the parameters of configuration of the cookies. So that the change is permanent it is necessary to invoke the change in all the documents.
session_cache_limiter ([cache_limiter]); If value is provided to him it modifies the value for defect on the other hand but there appears the cache memory that it takes as a defect.
session_encode (); He returns a chain with the information of a meeting, after using this function, the information of the meeting remains updated
session_decode (chain); Descodifica the chain that receives like parameter and that the meeting info contains, after using this function, updates the meeting info.
session_save_path ([path]); He returns the way to the directory where the files associated with the meeting keep. The alone effect lasts in the current script.
session_module_name ([module); He returns the name of the module that is used to realize the meetings management. When a parameter is invoked it is used like new meetings agent.
session_set_save_handler (open, close, read, write, destroy, gc);
It allows to define its own manejador to store the information associated with a meeting. Thus the information can be put in a BD instead of in a file. We have to spend like parameter all the necessary information to him to create and to destroy meetings.

Previous chapter:
Connection with MySQL

Following chapter:
Forms with PHP



 

 
Front
Chapters of the Manual of PHP
Introduction to PHP
Variables
My First Script PHP
Operators in PHP
Structures of Control
Functions in PHP
Code inclusion
Counterfoils (array)
Chains of Characters
Classes
Dates
Entry and Exit
Operations with Files
The language SQL and PHP
Connection with MySQL
Meetings
Forms with PHP
To practise in line
List of practices in line
FAQ
Frequent questions
Codes PHP
List of Codes PHP
Forums
Forums PHP
Other Manuals
Manuals of other languages
 
   
 
 
MySpaceScripts.info - Sitemap - Contact us - Sitemap - Contact us - Sitemap - Contact us

www.performance-media.com.br , incoming tour operator Poland , DMC Poland , buy-usedcars.co.uk , food supplements , Holzhäuser , Paid to Read Blog