RE: [PHP] Re: cookies under php 4.06
setcookie(UserName, $HTTP_POST_VARS['UserName'], time()+(60*10), /, $HTTP_SERVER_VARS['SERVER_NAME']); setcookie(Password, $password, time()+(60*10), /, $HTTP_SERVER_VARS['SERVER_NAME']); print login - set cookie; sorry for kinda answering my own post... but anyway... setcookie(UserName, $HTTP_POST_VARS['UserName']); setcookie(Password, $password); solves my problem, although means i can't have a time limit on my cookies i guess... but can set a time limit with another cookie... 1.) I would not store the user's password in a cookie. 2.) As far as I know, set_cookie() has worked the same since PHP3, so your problem is something else, not the PHP version. Are you sure $HTTP_SERVER_VARS['SERVER_NAME'] is the same as what's in the location bar in your browser. If the server name is set up as www.domain.com but the user is just at http://domain.com the cookie won't set. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookies disabled, new session ID each click!
What you describe is what SHOULD happen and does on that web site, that does NOT happen on my web site, with the exact same code I posted in the original message. So, the question remains, what would cause the SID to be blank every other click? Yes, I have also used Netscape on Linux to connect to the same machine without cookies, same result. Steve Jason Wong wrote: On Monday 04 November 2002 10:24, Steve Fatula wrote: If you want to see a site where the small program works (and be SURE and turn cookies off), click here: http://www.thewebmakerscorner.com/snapmods_new/default_test.php So, can anyone tell me why it does not work on MY site(s)? Any ideas? Surely this is a PHP configuration issue/bug perhaps? Logically, I don't see any settings that could possibly affect the outcome using this Have you tried any browsers other than IE 5.5? First time I go into that page, my URL shows this http://www.thewebmakerscorner.com/snapmods_new/default_test.php Clicking on the link appends the session id to the URL. As does clicking on the link again (same session id). Ad infinitum. So basically it works? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookies disabled, new session ID each click!
On Tuesday 05 November 2002 05:15, Steve Fatula wrote: What you describe is what SHOULD happen and does on that web site, that does NOT happen on my web site, with the exact same code I posted in the original message. Presumably the test website and your website are on different servers -- try comparing php.ini. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* That's life. What's life? A magazine. How much does it cost? Two-fifty. I only have a dollar. That's life. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookies disabled, new session ID each click!
On Monday 04 November 2002 10:24, Steve Fatula wrote: If you want to see a site where the small program works (and be SURE and turn cookies off), click here: http://www.thewebmakerscorner.com/snapmods_new/default_test.php So, can anyone tell me why it does not work on MY site(s)? Any ideas? Surely this is a PHP configuration issue/bug perhaps? Logically, I don't see any settings that could possibly affect the outcome using this Have you tried any browsers other than IE 5.5? First time I go into that page, my URL shows this http://www.thewebmakerscorner.com/snapmods_new/default_test.php Clicking on the link appends the session id to the URL. As does clicking on the link again (same session id). Ad infinitum. So basically it works? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* University politics are vicious precisely because the stakes are so small. -- Henry Kissinger */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Cookies
Thanks for responding. It turns out this is a known bug in 4.2.2 along with Apache 2.x.x according to the developers. The CVS snapshots seem to work, but I have moved back to Apache 1.3.x from the 2.x.x stuff. http://groups.google.com/groups?q=php+4.2.2+cookie+bugie=UTF-8oe=UTF-8hl= en So watch out for 4.2.2 if you use Apache 2.x.x. It seems to be okay with Apache 1.3.26. John -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 12:33 PM To: John S. Huggins Cc: [EMAIL PROTECTED] Subject: [PHP] Re: Cookies Say it is not so. I hear the PHP 4.2.2 will only set the last cookie delivered by a browser to a variable in the PHP environment. Is this true? Huh? Do you mean last cookie of the same NAME maybe? Because that's probably quite likely, and within 'spec' for the Cookie Spec. They will all be in an array $_COOKIE['foo'] rather than as a global $foo by default -- You can change that in php.ini if you don't care about security, which is a Bad Idea, but might be what you have to do until you convert... -- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookies - good or bad???
on 19/07/02 1:19 AM, Cord Schneider ([EMAIL PROTECTED]) wrote: A number of people have offered their opinion why cookies are a bad idea. As a developer new to PHP, if cookies are such a big a big no-no, how does one do effective session management without storing anything client-side?? Bear in mind that the browser is stateless and, the user can disconnect and reconnect in between fetching pages from your site. You pass the session around in the URL Something like A HREF=page.php?SIDclick here/a, or you might build a wrapper function that does it for you: A HREF=?=link('page.php')?click here/a. Yes, that's every internal (relative) URL on your whole site :) It becomes a trade-off between the convent but unreliable cookies, versus the 100% accessible, but perhaps time consuming/tricky URL method. As has been said on this list MANY times, just have a look at the big sites like amazon.com -- no cookies, no javascript, no reliance on client-side for anything. Take care of it all server-side, where you have a controlled environment. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookies - good or bad???
I never heard of this php function, link(). Sound like a good function, I'm going to have to look it up! Thanks, FletchSOD Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... on 19/07/02 1:19 AM, Cord Schneider ([EMAIL PROTECTED]) wrote: A number of people have offered their opinion why cookies are a bad idea. As a developer new to PHP, if cookies are such a big a big no-no, how does one do effective session management without storing anything client-side?? Bear in mind that the browser is stateless and, the user can disconnect and reconnect in between fetching pages from your site. You pass the session around in the URL Something like A HREF=page.php?SIDclick here/a, or you might build a wrapper function that does it for you: A HREF=?=link('page.php')?click here/a. Yes, that's every internal (relative) URL on your whole site :) It becomes a trade-off between the convent but unreliable cookies, versus the 100% accessible, but perhaps time consuming/tricky URL method. As has been said on this list MANY times, just have a look at the big sites like amazon.com -- no cookies, no javascript, no reliance on client-side for anything. Take care of it all server-side, where you have a controlled environment. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookies - good or bad???
on 19/07/02 4:49 AM, Scott Fletcher ([EMAIL PROTECTED]) wrote: I never heard of this php function, link(). Sound like a good function, I'm going to have to look it up! Ummm, sorry, it's one that I wrote myself in my library of code -- not an official function. my function link() takes the standard link, and adds the SID to it. It's not that tricky, all it does is check if there's already a query string, if there is, it appends the SID with , otherwise with ?. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: cookies
Surely it would be better to use Sessions in this case? Danny Shepherd [EMAIL PROTECTED] wrote in message 08c501c22825$932917c0$0200a8c0@DANNYS">news:08c501c22825$932917c0$0200a8c0@DANNYS... No, I just tested it myself - if you set a cookie with no expire date it exists until the browser window is closed. My code: ?php if (!isset($_COOKIE['TestCookie'])) { setcookie (TestCookie, FUD); echo Just Set a cookie - reload the page; } else { echo Cookie is : {$_COOKIE['TestCookie']}brClose the window then return and the cookie should be gone; } ? HTH Danny. - Original Message - From: vins [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 10, 2002 3:34 PM Subject: [PHP] Re: cookies Nope thats not they way If you don't specify a expire date it will live for ever or until you delete it. The only way is to set it with an expiry date and then it will delete it'self when the browser closes. Check this by running a file on the same domain with phpinfo(); Alexander Ross [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... How can I set a cookie which expires when the borwser is closed?? How can I delete a cookie via PHP? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: cookies
My experience with cookies that have no expiration date has not been as successful. It seems that (in IE6 anyway) the behavior is inconsistent. Sometimes the cookie would last until I closed the browser, sometimes the cookie would expire in the middle of the session for no apparent reason. This behavior may not occur in other browsers though. I'd test the cookies with the browser(s) that you will be using for your application. Lee richard.mail@so fthome.net To: [EMAIL PROTECTED] cc: 07/10/2002 Subject: [PHP] Re: cookies 09:58 AM Alexander Ross writes: How can I set a cookie which expires when the borwser is closed?? How can I delete a cookie via PHP? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php simply give it no experation time. then it will expire when your browser is closed :) ( and yes it works, i use it to ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: cookies
No, I just tested it myself - if you set a cookie with no expire date it exists until the browser window is closed. My code: ?php if (!isset($_COOKIE['TestCookie'])) { setcookie (TestCookie, FUD); echo Just Set a cookie - reload the page; } else { echo Cookie is : {$_COOKIE['TestCookie']}brClose the window then return and the cookie should be gone; } ? HTH Danny. - Original Message - From: vins [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 10, 2002 3:34 PM Subject: [PHP] Re: cookies Nope thats not they way If you don't specify a expire date it will live for ever or until you delete it. The only way is to set it with an expiry date and then it will delete it'self when the browser closes. Check this by running a file on the same domain with phpinfo(); Alexander Ross [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... How can I set a cookie which expires when the borwser is closed?? How can I delete a cookie via PHP? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookies and Variables
Keep it mind that EGPCS is in that order for a reason. Changing it can open up security problems... -JAson Garbr At 01:16 PM 11/20/2001 -0800, Fred wrote: If you want certain variables to over ride cookie variables you need to change the setting of the variables_order directive in php.ini: variables_order string Set the order of the EGPCS (Environment, GET, POST, Cookie, Server) variable parsing. The default setting of this directive is EGPCS. Setting this to GP, for example, will cause PHP to completely ignore environment variables, cookies and server variables, and to overwrite any GET method variables with POST-method variables of the same name. Fred Richard S. Crawford [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Consider this code, in page1.php: ?php setcookie(someWord,I am a cookie); ? ...and this code, in page2.php: ?php setcookie(someWord,$someWord); print (someWord says: $someWord); $someWord = I am a variable; print ( a href=\page2.php?someWord=$someWord\ Click here /a ); ? (In the actual code, the value of $someWord is passed via POST through a form, but the principle is the same.) The first time I load page2.php, the output should be: someWord says: I am a cookie Which, of course, works perfectly. But each subsequent time I load page2.php, I want the output to be: someWord says: I am a variable and then set the value of the cookie someWord to I am a variable. But that's not what happens. Everytime I load page2.php, someWord tells me that it is a cookie. How do I get the value of the variable to override the value of the cookie? Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: cookies
And this is where I say kma thanks. J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]