X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8EA11D1D070 for ; Thu, 8 Apr 2004 11:48:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 67020-04 for ; Thu, 8 Apr 2004 11:48:30 -0300 (ADT) Received: from outmx007.isp.belgacom.be (outmx007.isp.belgacom.be [195.238.3.234]) by svr1.postgresql.org (Postfix) with ESMTP id C8985D1C4EB for ; Thu, 8 Apr 2004 11:48:26 -0300 (ADT) Received: from chen.be (17.252-200-80.adsl-fix.skynet.be [80.200.252.17]) by outmx007.isp.belgacom.be (8.12.9/8.12.9/Skynet-OUT-2.21) with ESMTP id i38EmO69006136 for ; Thu, 8 Apr 2004 16:48:24 +0200 (envelope-from ) Message-ID: <4075665D.3060105@chen.be> Date: Thu, 08 Apr 2004 16:49:01 +0200 From: Wim Paulussen User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-php@postgresql.org Subject: Re: session_is_started() References: <20040408134031.GA13236@localhost.localdomain> In-Reply-To: <20040408134031.GA13236@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-RAVMilter-Version: 8.4.3(snapshot 20030212) (outmx007.isp.belgacom.be) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/15 X-Sequence-Number: 2672 I would do the following : on the first page you start the session with session_start and then you include an OK field in the session ($_SESSION['OK'] = TRUE; On the following pages , the first thing you do is check the existence of the variable like this if (! isset($_SESSION['OK'])) { session_start(); } Your problems derives most probably from teh fact that in your php.ini the session.autostart is set to On , starting a session automatically once 1 time started. Joolz wrote: >Hello, > >I'm makeing a PHP frontend to a postgresql db, and want to use >sessions in order to sore global variables. I read that it's enough to >put session_start() in the top file of the app, but that doesn't work, >when I go two or three PHP files "deep", the session is forgotten. > >To workaround this, I tried putting session_start() at the begonning >of every PHP file that does something with session variables. This >however gives me lot of these errors: "Notice: A session had already >been started - ignoring session_start() in [scriptname] on line 5" > >I would like something like > >if (!session_is_started()) { // note: this function doesn't exist > session_start(); >} > >How have you solved this problem? Thanks for any tips! > > >