Re: Cookies detect and $_SESSION

From: Date: Tue, 06 Aug 2002 00:17:17 +0000
Subject: Re: Cookies detect and $_SESSION
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-111367@lists.php.net to get a copy of this message
Hi Richard, Thank you for replying. OK, so I try it on the second page. This is good news. However, prior to mucking about with cookies and cookie detection, I had modified my whole site to 'access' (not sure if thais is right word) Sesssions via URL and SID. {Didn't work fully, so I decided to switch back and detect cookies.} In php.ini session.use_trans_sid=1, and I could pass $_SESSION stuff that way from the page in a href, but not from the menu on the side. So, I figured 'nuts-to-this' and I'll try to detect cookies, and tell 'em: "Switch them on to use the site". This is very frustrating to run into right at the end of coding. I feel rather duped by the fact that $_SESSION passes by cookies (by default). [I guess rftm is in order, but when you'rre learning this stuff, a little reference to that didn't make much sense. It does now!] Any interior calling to a line in db select such as: printf ("<tr><td><a href=select-add.php?rid=$myrow[rid]>%s</a></td> doesn't work. I've also tried $PHP_SELF and that strangely, barfs an error 'no such file' or sends the browser into la-la land forever. (yup, I've got globals=off, and everything works except for stuff passed to an https page (it doesn't). Probably the simplest solution for all of this (and this hurts my blossoming pride as a burgeoning programmer) is to write a static message telling them to turn on cookies. Any help would be greatly appreciated. Sorry to be so long-winded. Man, I'm some aggravated about this! Regards, Andre On Monday 05 August 2002 07:49 pm, you wrote: > >I'm trying to detect whether the user has cookies enabled on my opening > > page. > > You can *NEVER* be sure they have Cookies on the *FIRST* page. > > The Browser only sends *back* Cookie data you sent, and they can't have > gotten it yet. > > You can use your *SECOND* page to determine if they have Cookies. > > Or, you can get rid of the dependency on cookies using enable_trans_id in > php.ini > > All your URLs and such-like will then have the SID in them.

« previous php.general (#111367) next »