Re: Re: why are session only working with cookies?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 14, 2005 7:49 am, Brian V Bonini said:
> On Fri, 2005-05-13 at 23:31, Jason Wong wrote:
>> On Saturday 14 May 2005 09:42, Brian V Bonini wrote:
>>
>> > Yeah, I know session support is there and I DO NOT have it set to use
>> > ONLY cookies. But if I disable cookies in the browser stuff relying on
>> > sessions stops working. I'm using 5.0.3
>>
>> > session.use_trans_sid
>> > 0
>> > 0
>>
>> Set that to 1. Sessions *are* cookies, they're cookies that have been
>> set
>> to expire when the browsing session finishes (ie when the browser is
>> closed).
>
> I thought the idea was; cookies if available otherwise the session data
> gets serialized and propagated in the URL? The later of which appears to
> not work, for me, if applicable....

Sessions are *NOT* cookies.  PHP sessions use *A* Cookie to maintain state
-- specifically to indentify a singe user/browser on repeat HTTP
connections.

The session *data* is not going to be transmitted in the URL -- Only the
Cookie name/value pair will go in the URL.

Using Cookies, or using URL, the session DATA will be stored on the server
in /tmp files -- Unless you change php.ini to store them somewhere else,
in which case, again, the Cookie and URL only holds the ID and all the
data goes wherever you store it:  database, shared memory, or an army of
elves for all PHP cares.

If trans_sid is "not working" for you, let's narrow this down:

If you do this:
<?php
  session_start();
  echo "<a href=\"yourdomainnamehere.com\">click me</a><br />\n";
?>

Do you see something like "?PHPSESSID=a847hjfu3734hgfjgurur" tacked on to
the end of the URL?

If not, trans_sid is NOT enabled.

Did you restart Apache?

Did you turn *OFF* Cookies?  If PHP *can* use Cookies, I think it's gonna
use Cookies, and not bother with the trans_sid stuff, though maybe it
always puts it there.  I never really dived into that.  To be certain,
though, turn off Cookies in php.ini and/or in your browser.

Re-start Apache for your php.ini changes to kick in.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux