Posted by ZeldorBlat on 08/26/07 23:07
On Aug 26, 6:42 pm, "Fabio" <znt.fa...@virgilio.it> wrote:
> "ZeldorBlat" <zeldorb...@gmail.com> ha scritto nel messaggionews:1188167661.871089.223050@k79g2000hse.googlegroups.com...
>
>
>
> > Do you have session_start() at the beginning of your page?
>
> mmm... you're right, thanks.
> But I read somewhere that with $_SESSION it was useless to call
> session_start() and others session functions... :(
You're thinking of session_register()
>
> session_start() never reset the $_SESSION, right?
> I have to call it at evry page POST or I have to check if session was
> already started and only if not I will call session_start()?
>
Just call session_start() the top of every page. Otherwise the
session variables will not be available. If you do it once at the top
of the page you don't need to check if it's started every time you
want to access a session variable. Of course you could also enable
session.auto_start in php.ini -- but I wouldn't recommend that for a
variety of reasons.
[Back to original message]
|