Re: Doubt regarding session_destroy() in PHP 5

From: Date: Tue, 21 Jul 2009 20:22:14 +0000
Subject: Re: Doubt regarding session_destroy() in PHP 5
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-295649@lists.php.net to get a copy of this message
Keep in mind that sessions are based on the domain. I've run into situations where someone will be working in several different sites that we host. Each site is accessed via http://domain/site. Each site has it's own database, users, etc. However, because they all hang off the same domain, they get one session. That can really mess things up for the users as they go from site to site. I got around this by using MySQL-based sessions. It keeps things nice and separated. Take care, Floyd On Jul 21, 2009, at 4:14 PM, Devendra Jadhav wrote:
Yes. You are right. Session variables are associated with the session id so only that appropriate website's session variables will get destroyed. You can try it in your local system. On Wed, Jul 22, 2009 at 12:42 AM, Guruprasad <lgp171188@gmail.com> wrote:
Hi all, I have a doubt with creating and destroying sessions in PHP using session_destroy(). Supposing there is a PHP-based website hosted on a web server. Now I add another site that I developed using PHP on that web server using virtualhost. I destroy a session in my website using session_destroy() which will destroy all the session variables associated with my website. What will happen if I have the other website in another tab with similar session variable names? Will the session variables of that website be destroyed too? Or will the session variables be associated with the session id so that only the appropriate website's session variables will get destroyed? Thanks in advance. Regards, Guruprasad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--Devendra Jadhav


« previous php.general (#295649) next »