RE: [PHP] Confusing Session terminology
| From: | Brenton Bartel | Date: | Tue, 06 May 2003 05:58:05 +0000 |
| Subject: | RE: [PHP] Confusing Session terminology | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-146489@lists.php.net to get a copy of this message | ||
Yeah, I totally understand what you mean, but I need to include the class
declarations prior to session_start(), cause an instance of one of the classes
is being saved in the session. to do this I would need to split up where it's
called (which would not be all that often, depends on the page i'm viewing),
and later on where it's actually used .. which makes things more complicated
(it's a big site) cause then the stuff is too spread out .... but this is a
bit beside the point .... I'm still just curious as to whether or not it sends
the cookies irregardless when I tell it to not use cookie-based sessions.
thanks
>===== Original Message From Justin French <justin@indent.com.au> =====
>Not exactly *solving* your problem, but why can't you just session_start()
>at the top of the script, on every page, regardless?
>
>This is what I do with my main code base, and can only think of a few
>isolated instances where this wouldn't be desirable.
>
>
>Also, you should be able to do lots of include()'s of classes, libraries,
>code etc etc (providing they don't have any blank lines or other output in
>them) before the session_start()... eg:
>
><?
>include('something.class');
>include('foo.lib');
>include('otherstuff.php');
>
>if(something)
> {
> session_start();
> }
>?>
>
>
>
>Justin
>
>
>on 06/05/03 5:30 AM, Brenton Bartel (brentonb@uvic.ca) wrote:
>
>> Yes, session.use_cookies is set to 0 in my php.ini file. I even checked to
>> make sure using ini_set ().
>>
>> Background:
>> I have a hierarhical type structure to my site, to ensure consistency and
>> security, so everything goes through a single file and then various other
>> files are included as needed. I would prefer that session_start () be run
at a
>> point later on in the script so that I have type to figure out what classes
to
>> include, as these need to be included prior to starting the session. As it
>> stands, if session_start () is sending cookies no matter what, that means I
>> need extra conditions to include the classes, which would require them to
be
>> in a completely different place then where they are being used, thus
breaking
>> up my code, which just gets confusing ... follow??
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php