PHP4 Sessions and mod_layout/auto_append_file
| From: | Brian M Dial | Date: | Fri, 16 Jun 2000 19:00:10 +0000 |
| Subject: | PHP4 Sessions and mod_layout/auto_append_file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-2091@lists.php.net to get a copy of this message | ||
Greetings all,
I've been strugglign for a while now with getting a site to work like
this.
I installed mod_layout, which allows you to define a LayoutHeader and
LayoutFooter. This makes creating site looks very easy. I was also
trying to use PHP4 sessions as well. I created a header.php which
contains
session_start()
at the first line, then does the html layout I want. All goes well. In
the index.php document that's being wrapped, i can register a session
variable, and see that it's registered in the temp file. However, when
I follow a link to another page that also is in the layout, things go
awry
The session variable is being carried over correctly, I can echo the
$PHPSESSID and see that it's the same as was created on the index.php
page. However, I cannot access any of the session variables. As a
matter of fact, session_is_registered tells me it's not even registerd
to that session.
If I remove the header and footer, and just add the session_start() to
the begginning of the index.php page and the linked page, everything
works fine and I can access the variables that I register within the
script.
I've tried this with PHP's auto_append_file and auto_prepend_file too
but get many session errors. Is this unable to be done, that is using
sessions with page layouts? Anyone have any links or experiences to
share?
Thanks,
-Brian