Click to See Complete Forum and Search --> : Sessions (if cookies disabled)


Gweilo
09-28-2003, 04:03 PM
hi,

How do I pass the SESSID (for users, that have cookies disabled), if I use a post form? My first guess would be to do this:

<input type="hidden" name="PHPSESSID" value="<?=$sid?>" />

Would this work? Or does it even have to be passed manually?

I didn't find anything on the net, so I assume it is passed automatically. Hm, that makes me thinking. That would make it browser-dependent, and I don't like to rely on browsers...

Oh, and when I'm at it, another question popped up: I have two servers and one of them automatically adds PHPSESSID=bla to the URL, when the user has Cookies disabled. Sessions work fine there. The one passing the SID is Version 4.3.3 and the other one is 4.2.2

Does that mean, that I don't have to pass the SID, if my PHP version is 4.3(something) or greater?

I appreciate any help!

pyro
09-28-2003, 05:50 PM
It all depends on if session.use_trans_sid is set in the php.ini file. If it is, the sessions will be automatically passed, if not, you have to pass them manually. For more info, read http://us2.php.net/session#ini.session.use-trans-sid. Note that in PHP 4.1.2 or less, PHP must be compiled with --enable-trans-sid for this to work. In later versions, it is always complied, and just needs to be enabled (as it defaults to disabled) in the php.ini file.