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 36692D1D080 for ; Fri, 9 Apr 2004 10:47:51 -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 02188-08 for ; Fri, 9 Apr 2004 10:47:52 -0300 (ADT) Received: from smtp-out1.xs4all.nl (smtp-out1.xs4all.nl [194.109.24.11]) by svr1.postgresql.org (Postfix) with ESMTP id DE582D1D064 for ; Fri, 9 Apr 2004 10:47:48 -0300 (ADT) Received: from localhost.localdomain (kiar.xs4all.nl [80.126.234.5]) by smtp-out1.xs4all.nl (8.12.10/8.12.10) with ESMTP id i39Dlq7d077809 for ; Fri, 9 Apr 2004 15:47:52 +0200 (CEST) Received: by localhost.localdomain (Postfix, from userid 500) id 04CB1B6ED0; Fri, 9 Apr 2004 15:47:52 +0200 (CEST) Date: Fri, 9 Apr 2004 15:47:52 +0200 From: Joolz To: pgsql-php@postgresql.org Subject: Re: session_is_started() Message-ID: <20040409134752.GA14817@localhost.localdomain> Reply-To: pgsql-php@postgresql.org Mail-Followup-To: pgsql-php@postgresql.org References: <20040408134031.GA13236@localhost.localdomain> <4075665D.3060105@chen.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4075665D.3060105@chen.be> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/17 X-Sequence-Number: 2674 > [Wim Paulussen schreef op 08-04-2004 16:49 +0200] Hallo Wim, bedankt voor je reactie! (just saying hello to Wim) > 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(); > } > I tried this: if (!isset($_SESSION['id'])) { // id is a session variable that contains the user id session_start(); } The output is: Notice: A session had already been started - ignoring session_start() in [scriptname] on line 3 I can't figure out what's going wrong... > 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. No... It was on, but setting it off doesn't change the behaviour :-( > 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! > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings > -- 15:42-15:47 Fedora Core release 1 (Yarrow) Linux 2.4.22-1.2174.nptl