Re: [PHP-DB] cookie issue
--- Sukanto Kho <[EMAIL PROTECTED]> wrote: > Hah?? cookie do not have any id ?? so how to identify user when > same user > login from 2 different PC?? They have to log in again. How could you know that a user was the same from PC to PC if they didn't log in again? Now, that's not to say that you can't have two cookies on two different machines with the same user info. But as soon as they do anything on one machine that changes the cookie, the machines will be out of sync. You could store the info in a database, and just put a user-ID in the cookie. They'll have to log in once at each machine, but there is less chance of things gretting out of sync, since all changing data is in the db. BTW, sessions and cookies are not mutually exclusive. > > I prefer Session too... and I'm used to build website using session > but I found 1 problem is that ... session_id keep destroyed by my > web > hosting... > I'm not sure what cause the problem( web hosting or other)... > It's possible that they're clearing out the tmp directory where the session files are stored. Can you specify another location for them? > Or maybe the session life time expired??? but the session lifetime > just so > short.. > and I dont have the right given to change the session life time in > php.ini > (at my webhosting)... > and I think it's not quite nice to set the session lifetime using > PHP in my > each pages... Is sessions life something you could set in .htaccess? ... checking php docs... yes, session.save_path can be set in .htaccess or via ini_set(). Might be worth a try... In fact, almost all session settings can be set that way. > > I do appreciate ur advice but I think that's not the best solution > ...sorry, > I have to change all my pages to that...Quite wasting time . > > but Thanx a lot... > > - Original Message - > From: "zareef ahmed" <[EMAIL PROTECTED]> > To: "Sukanto Kho" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Friday, July 02, 2004 11:43 AM > Subject: Re: [PHP-DB] cookie issue > > > > > > Hi Sukanto, > > > > Cookies do not have any id like sessions. > > > > Headers in php sent in reverse order to browser, > > means the last one will send first, cookies also > > set/sent by headers, so This statement can be true. > > > > So, try setcookie function after you write redirection > > line like :: > > > > header("location :somewhere"); > > setcookie("name",$user_name, $time+3600); > > > > I hope this should work. > > > > Please let me know the status as I am also getting > > interest in it. > > > > BTW I prefer session to cookies... > > > > Zareef Ahmed > > > > > > --- Sukanto Kho <[EMAIL PROTECTED]> wrote: > > > Hi Mr. Zareef, > > > > > > I got issue from others that : > > > "With some browsers, setting a cookie and then > > > redirecting with header() > > > will not make the cookies available on the next > > > page" > > > I want to know how to solve that issue.. > > > > > > I set cookie like this : setcookie > > > ("name",$user_name, $time+3600); > > > but all I want is "cookie_id" (just like session > > > variable has session_id)... > > > > > > Thanx > > > Flame > > > > > > - Original Message - > > > From: "zareef ahmed" <[EMAIL PROTECTED]> > > > To: "Sukanto Kho" <[EMAIL PROTECTED]>; > > > <[EMAIL PROTECTED]> > > > Sent: Friday, July 02, 2004 10:58 AM > > > Subject: Re: [PHP-DB] cookie issue > > > > > > > > > > --- Sukanto Kho <[EMAIL PROTECTED]> wrote: > > > > > Hi All, > > > > > > > > > > Do cookie variable has cookie_id and how to call > > > it? > > > > > > > > How you set the cookie? > > > > It will be available as $_COOKIE['COOKIE_NAME']; > > > > > > > > > > > > > > Is Cookie_id same for 1 PC ?? or just in 1 > > > browser?? > > > > > > > > It is vaid for the pc but expire time applicable. > > > > > > > > > > > > > > How to avoid cookie not passed if using > > > redirecting > > > > > header(location:"")...sorry if I ask this > > > > > > > > Cookies stored on the client machine. If you do > > > not > > &
Re: [PHP-DB] cookie issue
Hah?? cookie do not have any id ?? so how to identify user when same user login from 2 different PC?? I prefer Session too... and I'm used to build website using session but I found 1 problem is that ... session_id keep destroyed by my web hosting... I'm not sure what cause the problem( web hosting or other)... Or maybe the session life time expired??? but the session lifetime just so short.. and I dont have the right given to change the session life time in php.ini (at my webhosting)... and I think it's not quite nice to set the session lifetime using PHP in my each pages... I do appreciate ur advice but I think that's not the best solution ...sorry, I have to change all my pages to that...Quite wasting time . but Thanx a lot... - Original Message - From: "zareef ahmed" <[EMAIL PROTECTED]> To: "Sukanto Kho" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, July 02, 2004 11:43 AM Subject: Re: [PHP-DB] cookie issue > > Hi Sukanto, > > Cookies do not have any id like sessions. > > Headers in php sent in reverse order to browser, > means the last one will send first, cookies also > set/sent by headers, so This statement can be true. > > So, try setcookie function after you write redirection > line like :: > > header("location :somewhere"); > setcookie("name",$user_name, $time+3600); > > I hope this should work. > > Please let me know the status as I am also getting > interest in it. > > BTW I prefer session to cookies... > > Zareef Ahmed > > > --- Sukanto Kho <[EMAIL PROTECTED]> wrote: > > Hi Mr. Zareef, > > > > I got issue from others that : > > "With some browsers, setting a cookie and then > > redirecting with header() > > will not make the cookies available on the next > > page" > > I want to know how to solve that issue.. > > > > I set cookie like this : setcookie > > ("name",$user_name, $time+3600); > > but all I want is "cookie_id" (just like session > > variable has session_id)... > > > > Thanx > > Flame > > > > - Original Message - > > From: "zareef ahmed" <[EMAIL PROTECTED]> > > To: "Sukanto Kho" <[EMAIL PROTECTED]>; > > <[EMAIL PROTECTED]> > > Sent: Friday, July 02, 2004 10:58 AM > > Subject: Re: [PHP-DB] cookie issue > > > > > > > --- Sukanto Kho <[EMAIL PROTECTED]> wrote: > > > > Hi All, > > > > > > > > Do cookie variable has cookie_id and how to call > > it? > > > > > > How you set the cookie? > > > It will be available as $_COOKIE['COOKIE_NAME']; > > > > > > > > > > > Is Cookie_id same for 1 PC ?? or just in 1 > > browser?? > > > > > > It is vaid for the pc but expire time applicable. > > > > > > > > > > > How to avoid cookie not passed if using > > redirecting > > > > header(location:"")...sorry if I ask this > > > > > > Cookies stored on the client machine. If you do > > not > > > want to use them simply set them with no value. > > > See manual of setcookie() for more details. > > > > > > > before...but still havent get any suggestion. > > > > > > No Problem. You are welcome. > > > > > > > > > Zareef Ahmed > > > > > > > > Thanx > > > > Flame > > > > > > > > > > > > > = > > > Zareef Ahmed :: A PHP Developer in Delhi(India). > > > Homepage :: http://www.zasaifi.com > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > = > Zareef Ahmed :: A PHP Developer in Delhi(India). > Homepage :: http://www.zasaifi.com > > > > > __ > Do you Yahoo!? > New and Improved Yahoo! Mail - 100MB free storage! > http://promotions.yahoo.com/new_mail > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] cookie issue
Hi Sukanto, Cookies do not have any id like sessions. Headers in php sent in reverse order to browser, means the last one will send first, cookies also set/sent by headers, so This statement can be true. So, try setcookie function after you write redirection line like :: header("location :somewhere"); setcookie("name",$user_name, $time+3600); I hope this should work. Please let me know the status as I am also getting interest in it. BTW I prefer session to cookies... Zareef Ahmed --- Sukanto Kho <[EMAIL PROTECTED]> wrote: > Hi Mr. Zareef, > > I got issue from others that : > "With some browsers, setting a cookie and then > redirecting with header() > will not make the cookies available on the next > page" > I want to know how to solve that issue.. > > I set cookie like this : setcookie > ("name",$user_name, $time+3600); > but all I want is "cookie_id" (just like session > variable has session_id)... > > Thanx > Flame > > - Original Message - > From: "zareef ahmed" <[EMAIL PROTECTED]> > To: "Sukanto Kho" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: Friday, July 02, 2004 10:58 AM > Subject: Re: [PHP-DB] cookie issue > > > > --- Sukanto Kho <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > > > > Do cookie variable has cookie_id and how to call > it? > > > > How you set the cookie? > > It will be available as $_COOKIE['COOKIE_NAME']; > > > > > > > > Is Cookie_id same for 1 PC ?? or just in 1 > browser?? > > > > It is vaid for the pc but expire time applicable. > > > > > > > > How to avoid cookie not passed if using > redirecting > > > header(location:"")...sorry if I ask this > > > > Cookies stored on the client machine. If you do > not > > want to use them simply set them with no value. > > See manual of setcookie() for more details. > > > > > before...but still havent get any suggestion. > > > > No Problem. You are welcome. > > > > > > Zareef Ahmed > > > > > > Thanx > > > Flame > > > > > > > > > = > > Zareef Ahmed :: A PHP Developer in Delhi(India). > > Homepage :: http://www.zasaifi.com > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > = Zareef Ahmed :: A PHP Developer in Delhi(India). Homepage :: http://www.zasaifi.com __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] cookie issue
Hi Mr. Zareef, I got issue from others that : "With some browsers, setting a cookie and then redirecting with header() will not make the cookies available on the next page" I want to know how to solve that issue.. I set cookie like this : setcookie ("name",$user_name, $time+3600); but all I want is "cookie_id" (just like session variable has session_id)... Thanx Flame - Original Message - From: "zareef ahmed" <[EMAIL PROTECTED]> To: "Sukanto Kho" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, July 02, 2004 10:58 AM Subject: Re: [PHP-DB] cookie issue > --- Sukanto Kho <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > Do cookie variable has cookie_id and how to call it? > > How you set the cookie? > It will be available as $_COOKIE['COOKIE_NAME']; > > > > > Is Cookie_id same for 1 PC ?? or just in 1 browser?? > > It is vaid for the pc but expire time applicable. > > > > > How to avoid cookie not passed if using redirecting > > header(location:"")...sorry if I ask this > > Cookies stored on the client machine. If you do not > want to use them simply set them with no value. > See manual of setcookie() for more details. > > > before...but still havent get any suggestion. > > No Problem. You are welcome. > > > Zareef Ahmed > > > > Thanx > > Flame > > > > > = > Zareef Ahmed :: A PHP Developer in Delhi(India). > Homepage :: http://www.zasaifi.com > > > > > __ > Do you Yahoo!? > New and Improved Yahoo! Mail - 100MB free storage! > http://promotions.yahoo.com/new_mail > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] cookie issue
--- Sukanto Kho <[EMAIL PROTECTED]> wrote: > Hi All, > > Do cookie variable has cookie_id and how to call it? How you set the cookie? It will be available as $_COOKIE['COOKIE_NAME']; > > Is Cookie_id same for 1 PC ?? or just in 1 browser?? It is vaid for the pc but expire time applicable. > > How to avoid cookie not passed if using redirecting > header(location:"")...sorry if I ask this Cookies stored on the client machine. If you do not want to use them simply set them with no value. See manual of setcookie() for more details. > before...but still havent get any suggestion. No Problem. You are welcome. Zareef Ahmed > > Thanx > Flame > = Zareef Ahmed :: A PHP Developer in Delhi(India). Homepage :: http://www.zasaifi.com __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] cookie issue
Hi All, Do cookie variable has cookie_id and how to call it? Is Cookie_id same for 1 PC ?? or just in 1 browser?? How to avoid cookie not passed if using redirecting header(location:"")...sorry if I ask this before...but still havent get any suggestion. Thanx Flame
RE: [PHP-DB] Cookie issue
To add to this message: We are having problems with people using IE 6.0. They appear to sign-in and then are returned to the sign-in screen over and over. This doesnt happen to all that use the site. Thanks in advance -Original Message- From: Marie Osypian [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:03 AM To: PHP-DB Subject: [PHP-DB] Cookie issue We are having complaints on our site about users not being able to log-in and we feel it maybe related to the setting of cookie. Here is the code used. Can anyone give me insight. /* some standard var's or other things like srand */ srand((double)microtime() * 100); $includes_root = "$DOCUMENT_ROOT/includes"; $encoded_url= urlencode($REQUEST_URI); if($_COOKIE["cookie_check"] != "Y") { setcookie("cookie_check", "Y", strtotime("+5 years"), "/", "$HTTP_HOST", 0); } if($_COOKIE["current_surfer_id"] == "" AND $_COOKIE["cookie_check"] == "Y") { $current_surfer_id = rand(0, 16777215); setcookie("current_surfer_id", $current_surfer_id, strtotime("+5 years"), "/", "$HTTP_HOST", 0); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Cookie issue
We are having complaints on our site about users not being able to log-in and we feel it maybe related to the setting of cookie. Here is the code used. Can anyone give me insight. /* some standard var's or other things like srand */ srand((double)microtime() * 100); $includes_root = "$DOCUMENT_ROOT/includes"; $encoded_url= urlencode($REQUEST_URI); if($_COOKIE["cookie_check"] != "Y") { setcookie("cookie_check", "Y", strtotime("+5 years"), "/", "$HTTP_HOST", 0); } if($_COOKIE["current_surfer_id"] == "" AND $_COOKIE["cookie_check"] == "Y") { $current_surfer_id = rand(0, 16777215); setcookie("current_surfer_id", $current_surfer_id, strtotime("+5 years"), "/", "$HTTP_HOST", 0); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Cookie issue
It's probably an issue with security settings in IE6, not your code. Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: "Marie Osypian" <[EMAIL PROTECTED]> To: "PHP-DB" <[EMAIL PROTECTED]> Sent: Thursday, 05 June, 2003 11:30 Subject: RE: [PHP-DB] Cookie issue To add to this message: We are having problems with people using IE 6.0. They appear to sign-in and then are returned to the sign-in screen over and over. This doesnt happen to all that use the site. Thanks in advance -Original Message- From: Marie Osypian [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:03 AM To: PHP-DB Subject: [PHP-DB] Cookie issue We are having complaints on our site about users not being able to log-in and we feel it maybe related to the setting of cookie. Here is the code used. Can anyone give me insight. /* some standard var's or other things like srand */ srand((double)microtime() * 100); $includes_root = "$DOCUMENT_ROOT/includes"; $encoded_url= urlencode($REQUEST_URI); if($_COOKIE["cookie_check"] != "Y") { setcookie("cookie_check", "Y", strtotime("+5 years"), "/", "$HTTP_HOST", 0); } if($_COOKIE["current_surfer_id"] == "" AND $_COOKIE["cookie_check"] == "Y") { $current_surfer_id = rand(0, 16777215); setcookie("current_surfer_id", $current_surfer_id, strtotime("+5 years"), "/", "$HTTP_HOST", 0); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php