Skip site navigation (1) Skip section navigation (2)

session_is_started()

From: Joolz <joolz(at)xs4all(dot)nl>
To: list-postgresql-php <pgsql-php(at)postgresql(dot)org>
Subject: session_is_started()
Date: 2004-04-08 13:40:31
Message-ID: 20040408134031.GA13236@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-php
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!

-- 
15:36-15:40
Fedora Core release 1 (Yarrow) Linux 2.4.22-1.2174.nptl

Responses

pgsql-php by date

Next:From: Wim PaulussenDate: 2004-04-08 14:49:01
Subject: Re: session_is_started()
Previous:From: Steve CrawfordDate: 2004-04-08 00:29:51
Subject: Re: Pie/Bar chart

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group