Re: Help on Session and cockies

From: Date: Thu, 06 Jun 2002 17:38:50 +0000
Subject: Re: Help on Session and cockies
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-100970@lists.php.net to get a copy of this message
With sessions, the session_start(); function will initiate a session in the severs tmp directory with a file name such as 55abhc8a83kqk etc. The session_name("name_of_var"); function allows you to create a unique name for your session vs. the 55abhc8a83kqk. A good way to check your sessions is to do something like this: <?php session_start(); session_name(testing sessions); print "<p>$session_id</p>"; ?> Or if you want to assign session vars, or unique variables you can do something like this <?php $unique_number = rand(); // generates a uniqe number session_start(); // starts the session session_name($unique_number); // names the session the unique number session_register($unique_number); // registers the unique number as a session var print = "<p>$unique_number is your session id</p><p>$unique_number is your registered variable</p>"; ?> If you go to php.net you can look up session() in the function list and it will break it down alot better for you HTH Jas "Marcos Lois BermúDez" <marcos.lois@iqc-services.com> wrote in message news:5.1.0.14.2.20020606192715.02a85960@pop3.iqc-services.com... A have two webs made in php, both uses a authentication based on session suport. I use in every page a session_start(); and a session_name( name); to get different name for the sessions but when i get login i one web, and then go to the other i get the same login. what happend? What means the session_name? I use php-4.2.0 and apache-1.3.24 in a lunux box. Any help will be apreciated. Regards. ---------------------------------------------------- Marcos Lois Bermúdez marcos@iqc-services.com IQC-Services. Carretera provincial 60 - 1 36210 Vigo - Pontevedra Tel: +34 986 281 830 Fax: +34 986 415 074 http://www.iqc-services.com ----------------------------------------------------

« previous php.general (#100970) next »