Re: [PHP] PHP session variables

2012-08-16 Thread Tedd Sperling
On Aug 15, 2012, at 4:13 PM, Robert Cummings wrote: > > I only pointed it out because I used to do exactly the same thing :) > > Cheers, > Rob. Thanks, I was starting to feel pretty dumb. Cheers, tedd _ t...@sperling.com http://sperling.com -- PHP General Mailing List

Re: [PHP] PHP session variables

2012-08-16 Thread Tedd Sperling
On Aug 15, 2012, at 4:42 PM, Andrew Ballard wrote: > On Wed, Aug 15, 2012 at 3:24 PM, Tedd Sperling wrote: >> The php manual ( http://us3.php.net/manual/en/function.session-start.php ) >> >> First Note states that session_start() must be called *before* anything sent >> to the Browser. >> >> S

Re: [PHP] PHP session variables

2012-08-15 Thread Andrew Ballard
On Wed, Aug 15, 2012 at 3:24 PM, Tedd Sperling wrote: > Your points are well taken -- thanks. I've seen a lot of people code that way, so it's easy to miss. In your original code, that first statement was calling session_start() 1,000 times. This is because the first time through, SID is undefine

Re: [PHP] PHP session variables

2012-08-15 Thread Robert Cummings
On 12-08-15 03:19 PM, Tedd Sperling wrote: Rob: Again thanks. Sorry, I totally missed your point. In my "defense" I commonly use the value returned from microtime() as a string and not as a float. The code that followed my "microtime( false );" demo broke the string and recombined it into a

Re: [PHP] PHP session variables

2012-08-15 Thread Tedd Sperling
Andrew: Your points are well taken -- thanks. However, my only concern is given this: > for($i=1; $i < 1000; $i++) >{ >if (!defined('SID')) > { > echo __LINE__, '::session_start()'; > session_start(); > } >} The php manual ( http:

Re: [PHP] PHP session variables

2012-08-15 Thread Tedd Sperling
On Aug 14, 2012, at 11:01 AM, Robert Cummings wrote: > > I'm not sure if you're making a joke, but your changes have no effect. You've > merely explicitly stated the optional parameter's default value. What I had > meant was to change the following: > > > $starttime = microtime(); > $startar

Re: [PHP] PHP session variables

2012-08-15 Thread Andrew Ballard
On Fri, Aug 10, 2012 at 11:56 AM, Tedd Sperling wrote: > On Aug 10, 2012, at 11:45 AM, Tedd Sperling wrote: > >> On Aug 9, 2012, at 5:16 PM, Jim Lucas wrote: >>> You are relying on PHP's loose typing. This is a poor check. >>> >>> session_id() returns a string, not boolean. >>> >>> You should d

Re: [PHP] PHP session variables

2012-08-14 Thread tamouse mailing lists
On Aug 14, 2012 1:36 AM, "tamouse mailing lists" wrote: > > > On Aug 13, 2012 8:01 AM, "Robert Cummings" wrote: > > > > On 12-08-10 04:42 PM, Tedd Sperling wrote: > >> > >> On Aug 10, 2012, at 1:21 PM, Ege Sertçetin wrote: > >> > >>> Hi. My question will maybe out of topic, I'm sorry. > >>> How

Re: [PHP] PHP session variables

2012-08-14 Thread Robert Cummings
On 12-08-14 10:41 AM, Tedd Sperling wrote: On Aug 13, 2012, at 10:59 AM, Robert Cummings wrote: On 12-08-10 04:42 PM, Tedd Sperling wrote: On Aug 10, 2012, at 1:21 PM, Ege Sertçetin wrote: Hi. My question will maybe out of topic, I'm sorry. How can you know that one way will be much slower

Re: [PHP] PHP session variables

2012-08-14 Thread Tedd Sperling
On Aug 13, 2012, at 10:59 AM, Robert Cummings wrote: > On 12-08-10 04:42 PM, Tedd Sperling wrote: >> On Aug 10, 2012, at 1:21 PM, Ege Sertçetin wrote: >> >>> Hi. My question will maybe out of topic, I'm sorry. >>> How can you know that one way will be much slower than other one? I mean, >>> ho

Re: [PHP] PHP session variables

2012-08-14 Thread tamouse mailing lists
On Aug 13, 2012 8:01 AM, "Robert Cummings" wrote: > > On 12-08-10 04:42 PM, Tedd Sperling wrote: >> >> On Aug 10, 2012, at 1:21 PM, Ege Sertçetin wrote: >> >>> Hi. My question will maybe out of topic, I'm sorry. >>> How can you know that one way will be much slower than other one? I mean, how can

Re: [PHP] PHP session variables

2012-08-13 Thread Robert Cummings
On 12-08-10 04:42 PM, Tedd Sperling wrote: On Aug 10, 2012, at 1:21 PM, Ege Sertçetin wrote: Hi. My question will maybe out of topic, I'm sorry. How can you know that one way will be much slower than other one? I mean, how can I learn which function is faster before I test it? Ege: No your

Re: [PHP] PHP session variables

2012-08-12 Thread Tedd Sperling
On Aug 10, 2012, at 1:21 PM, Ege Sertçetin wrote: > Hi. My question will maybe out of topic, I'm sorry. > How can you know that one way will be much slower than other one? I mean, how > can I learn which function is faster before I test it? Ege: No your question is on topic. This question sho

Re: [PHP] PHP session variables

2012-08-12 Thread Marco Behnke
Am 09.08.12 23:16, schrieb Jim Lucas: > On 08/09/2012 01:45 PM, Tedd Sperling wrote: >> On Aug 8, 2012, at 5:41 PM, Jim Giner >> wrote: >> >>> On 8/8/2012 11:24 AM, Ansry User 01 wrote: I am setting the _SESSION variables in one of my file, but whenever I leave the php page session varia

Re: [PHP] PHP session variables

2012-08-10 Thread Tedd Sperling
On Aug 10, 2012, at 11:45 AM, Tedd Sperling wrote: > On Aug 9, 2012, at 5:16 PM, Jim Lucas wrote: >> You are relying on PHP's loose typing. This is a poor check. >> >> session_id() returns a string, not boolean. >> >> You should do this instead. >> >> if ( session_id() === '' ) >> >> >

Re: [PHP] PHP session variables

2012-08-10 Thread Tedd Sperling
On Aug 9, 2012, at 5:16 PM, Jim Lucas wrote: > You are relying on PHP's loose typing. This is a poor check. > > session_id() returns a string, not boolean. > > You should do this instead. > > if ( session_id() === '' ) > > > > -- > Jim Lucas Thanks Jim -- you're right. What about? i

Re: [PHP] PHP session variables

2012-08-09 Thread Jim Lucas
On 08/09/2012 01:45 PM, Tedd Sperling wrote: On Aug 8, 2012, at 5:41 PM, Jim Giner wrote: On 8/8/2012 11:24 AM, Ansry User 01 wrote: I am setting the _SESSION variables in one of my file, but whenever I leave the php page session variables are not accessible. Not sure what I need to do addi

Re: [PHP] PHP session variables

2012-08-09 Thread Tedd Sperling
On Aug 8, 2012, at 5:41 PM, Jim Giner wrote: > On 8/8/2012 11:24 AM, Ansry User 01 wrote: >> I am setting the _SESSION variables in one of my file, but whenever I leave >> the php page session variables are not accessible. Not sure what I need to >> do additionally other then defining _SESSION[

RE: [PHP] PHP session variables

2012-08-08 Thread Jen Rasmussen
-Original Message- From: David Harkness [mailto:davi...@highgearmedia.com] Sent: Wednesday, August 08, 2012 11:53 AM To: Ansry User 01 Cc: php-general@lists.php.net Subject: Re: [PHP] PHP session variables On Wed, Aug 8, 2012 at 8:24 AM, Ansry User 01 wrote: > I am setting the _SESS

Re: [PHP] PHP session variables

2012-08-08 Thread David Harkness
On Wed, Aug 8, 2012 at 8:24 AM, Ansry User 01 wrote: > I am setting the _SESSION variables in one of my file, but whenever I > leave the php page session variables are not accessible. As always, post some code demonstrating what you're doing. Help us help you! :) David

Re: [PHP] PHP session variables

2012-08-08 Thread Daniel Brown
On Wed, Aug 8, 2012 at 11:24 AM, Ansry User 01 wrote: > I am setting the _SESSION variables in one of my file, but whenever I leave > the php page session variables are not accessible. Not sure what I need to do > additionally other then defining _SESSION[]. > Any pointer. If you're not tel

Re: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Andy Higgins
Hi Gerard, Thank you for your assistance you have been of enormous help. Regards, Andy "Gerard Samuel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Saturday 27 December 2003 10:54 am, Andy Higgins wrote: > > > 1. At the time of login will the login code need to check if the c

Re: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Gerard Samuel
On Saturday 27 December 2003 10:54 am, Andy Higgins wrote: > 1. At the time of login will the login code need to check if the clients > browser accepts cookies and if not then append the SID as described? If so, > do you perhaps have a sample piece of code that does this? No, php does this for yo

Re: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Andy Higgins
Hi Mark, Thank you for confirming that for me. I am new to the list and did do a search though past messages but did not find this point (obvioulsy I did not look hard enough). Thanks again. Regards, Andy "Mark Charette" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > -Orig

RE: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Mark Charette
> -Original Message- > From: Andy Higgins [mailto:[EMAIL PROTECTED] > Can anyone confirm whether > AOL (or any > other ISPs for that matter) change a user's IP address as seen by the web > server (for eample through a proxy) within the same session? It's been pointed out and confirmed many

Re: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Andy Higgins
Hi Gerard, Thank you very much for the response. Please can you clarify the following: 1. At the time of login will the login code need to check if the clients browser accepts cookies and if not then append the SID as described? If so, do you perhaps have a sample piece of code that does this? 2

Re: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Gerard Samuel
On Saturday 27 December 2003 07:03 am, Andy Higgins wrote: > Hello All, > > I have been racking my head over a problem where a large percentage of > users are unable to log into my php site due to what seems to be a problem > with setting php session variables on certain end user browsers (certain

Re: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Andy Higgins
Hi Andras, Yes, good point Thank you. It could be that the IP address of the user is changing on each HTTP request that is made, which would explain the problem (although that does seem quite odd). Can anyone confirm whether AOL (or any other ISPs for that matter) change a user's IP address as see

RE: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Andras Kende
-Original Message- From: Andy Higgins [mailto:[EMAIL PROTECTED] Sent: Saturday, December 27, 2003 6:04 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP Session Variables Not Being Set For Certain Browsers Hello All, I have been racking my head over a problem where a large percentage of users