[PHP] seesions problem

2004-02-27 Thread Pance
I've been using the same code to verify a persons login for more than a
year - but I've been having some problems lately - I get past the login, but
the session times-out after about 30 seconds or a minute. My new server is
using PHP ver 4.3.3. I've also read the docs on "sessions" and I've taken
their suggestion and have stopped using session_register("user_id"). I now
use $_SESSION["user_id"]).

But, like I said after about a short minute, I get the following error
message:

Notice: Undefined index: user_id in /home/pance/public_html/menu.php on line
13

Has anybody else come accross this problem - and how did you solve it?

Pance Stojkovski

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: seesions problem

2004-02-27 Thread Pance
Thanks to everybody's suggestions. But the problem won't go away just by
ignoring the "Notice". I'm using  $_SESSION["user_id"]) as a validation tool
to verify that the user has logged in. I have looked at all the vars in
phpinfo() (I don't have access to the server ini files). And I can't see
anything wrong.

For example, today, I had the same page open for more than an hour, and my
session code worked well. But other times, I'll work for 30 seconds and it
will time out.

I've asked my server host - and they say they havn't made any changes.

I've asked my internet provider - and they're clueless.

I've played with the settings on my MS-IE (ver 5.5) - still no luck.

Yes, I use "session_start() " at the beginning of all my PHP files.

Currently, I'm still in development - but the site will go up live by Monday
or Tuesday and it would be very embarrasing if the users were told to login
every 30 seconds.

Pance.



"Pance" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've been using the same code to verify a persons login for more than a
> year - but I've been having some problems lately - I get past the login,
but
> the session times-out after about 30 seconds or a minute. My new server is
> using PHP ver 4.3.3. I've also read the docs on "sessions" and I've taken
> their suggestion and have stopped using session_register("user_id"). I now
> use $_SESSION["user_id"]).
>
> But, like I said after about a short minute, I get the following error
> message:
>
> Notice: Undefined index: user_id in /home/pance/public_html/menu.php on
line
> 13
>
> Has anybody else come accross this problem - and how did you solve it?
>
> Pance Stojkovski

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Session and MS-IE6

2004-03-02 Thread Pance
I verify users to my website with sessions. It's been working fine for the
past couple of years, but recently I started having some problems using
sessions for example:
   session_register("user_id");
   if (!(user_id)){ 

and then I read the PHP manual and it suggested this instead:
  session_start();
  if (!$_SESSION['user_id']){ 

which worked on my machine (Win98 and MS-IE5.5). But today I tried to login
to my page from the client's computer using MS-IE 6 and I got the error:
undefined index 'user-id'

Does anybody know what's going on? Is there a bug with MS-IE6 when using
sessions? I've read some of the other comments here about IE6 but they apply
to forms, not sessions.

Pance.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Session and MS-IE6

2004-03-02 Thread Pance
>Have you tried other browsers ?
I've tried MS-IE 5.5 and Mozilla 1.4b on my Win98 computer. They both work.
I've tried MS-IE6 on my clients Win98 computer - it didn't work.

> What server/os/php is on your machine and what on client's ?
My server is runing Linux 2.4.24 #3; PHP-4.3.3; Zend 1.3.0

> Can you post the session management part of tour code ?
I'm not sure what you mean by "session management". I use:
session_start();
at the top of every PHP page and I try to verify the user by:
if (!$_SESSION['user_id']){
  printf("You have not logged in. Please click this to
do so.");
 exit();
}

Pance.


"Puiu Hrenciuc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Have you tried other browsers ?
> Before you can say it is a browser issue you have to try as
> many browsers as possible and see if the problem is still there.
> What server/os/php is on your machine and what on client's ?
> Can you post the session management part of tour code ?
> Please provide more info in order to be able to get help.
>
>
> "Pance" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I verify users to my website with sessions. It's been working fine for
the
> > past couple of years, but recently I started having some problems using
> > sessions for example:
> >session_register("user_id");
> >if (!(user_id)){ 
> >
> > and then I read the PHP manual and it suggested this instead:
> >   session_start();
> >   if (!$_SESSION['user_id']){ 
> >
> > which worked on my machine (Win98 and MS-IE5.5). But today I tried to
> login
> > to my page from the client's computer using MS-IE 6 and I got the error:
> > undefined index 'user-id'
> >
> > Does anybody know what's going on? Is there a bug with MS-IE6 when using
> > sessions? I've read some of the other comments here about IE6 but they
> apply
> > to forms, not sessions.
> >
> > Pance.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Sessions, sessions and... sessions

2004-03-02 Thread Pance
Hi Puiu,
I've been having the same problem too. My code that worked up until recently
just stopped working. I did change from using:
   session_register("user_id");
   if (!(user_id)){ 

to using:
  session_start();
  if (!$_SESSION['user_id']){ 

Now it works with my computer Win98 and MS-IE5.5 but not on my client's
computer Win98 and MS-IE6.

I think there's something seriously wrong somewhere (either PHP or MS). I'll
keep you posted if I find a solution.

Pance.

"Puiu Hrenciuc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I am a little desperate right now since I have tried to solve this problem
> for 3-4 days now.
> I have developed a site that uses sessions for user authentication and
data
> storage between page access.
> The development server is Apache1.3.24/MySQL4.1.0/PHP4.3.3/Win XP Pro
> The release server is Apache1.3.27/MySQ3.2.25/PHP4.3.1/Linux 2.4.25
>
> The site is working just fine on the development server, but when
uploading
> on release
> server it keeps losing session data and the users are logged out of their
> account in a
> randomly manner. I can't reproduce the behaviour since it is all randomly,
> for eg.
> the session may expire immediately but it can also last 30-40 min. It does
> not expire
> on same page every time. I have tried to see if it is a browser related
> issue so I have loaded
> the page into IE6, NN7, OPERA7 but the problem persisted. Next step I
> thought that it
> could be a process on the release server that deletes files on /tmp so I
> have changed the
> session_save_path to another dir, same problem. Now I have made some
> functions
> and keep the sessions in a MySQL database. It works fine on the
development
> server,
> but... , BUT... , it has the same behaviour on the release server. Using
> MySQL storage
> I have discovered the PHP changes SIDs randomly ( at least so it seems )
so
> the session's
> data is not lost ( the MySQL record is there, and the data field is ok,
all
> variables are there
> kindly waiting to be read by PHP :) ), but new sessions are created for
same
> connection
> so I think this is PHP or Cookies related.
> If you would like to see the phpinfo() snapshots:
> Development server : http://www.pur.ro/devphpinfo.htm
> Release server : http://www.pur.ro/relphpinfo.htm
>
> Can someone please help me, coz' my hair is turning white and I'm too
young
> to die :)
>
> Thanks,
> Puiu Hrenciuc.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Sessions, sessions and... sessions

2004-03-02 Thread Pance
Hi Puiu,
I've been having the same problem too. My code that worked up until recently
just stopped working. I did change from using:
   session_register("user_id");
   if (!(user_id)){ 

to using:
  session_start();
  if (!$_SESSION['user_id']){ 

Now it works with my computer Win98 and MS-IE5.5 but not on my client's
computer Win98 and MS-IE6.

I think there's something seriously wrong somewhere (either PHP or MS). I'll
keep you posted if I find a solution.

Pance.

"Puiu Hrenciuc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I am a little desperate right now since I have tried to solve this problem
> for 3-4 days now.
> I have developed a site that uses sessions for user authentication and
data
> storage between page access.
> The development server is Apache1.3.24/MySQL4.1.0/PHP4.3.3/Win XP Pro
> The release server is Apache1.3.27/MySQ3.2.25/PHP4.3.1/Linux 2.4.25
>
> The site is working just fine on the development server, but when
uploading
> on release
> server it keeps losing session data and the users are logged out of their
> account in a
> randomly manner. I can't reproduce the behaviour since it is all randomly,
> for eg.
> the session may expire immediately but it can also last 30-40 min. It does
> not expire
> on same page every time. I have tried to see if it is a browser related
> issue so I have loaded
> the page into IE6, NN7, OPERA7 but the problem persisted. Next step I
> thought that it
> could be a process on the release server that deletes files on /tmp so I
> have changed the
> session_save_path to another dir, same problem. Now I have made some
> functions
> and keep the sessions in a MySQL database. It works fine on the
development
> server,
> but... , BUT... , it has the same behaviour on the release server. Using
> MySQL storage
> I have discovered the PHP changes SIDs randomly ( at least so it seems )
so
> the session's
> data is not lost ( the MySQL record is there, and the data field is ok,
all
> variables are there
> kindly waiting to be read by PHP :) ), but new sessions are created for
same
> connection
> so I think this is PHP or Cookies related.
> If you would like to see the phpinfo() snapshots:
> Development server : http://www.pur.ro/devphpinfo.htm
> Release server : http://www.pur.ro/relphpinfo.htm
>
> Can someone please help me, coz' my hair is turning white and I'm too
young
> to die :)
>
> Thanks,
> Puiu Hrenciuc.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Session and MS-IE6

2004-03-02 Thread Pance
You are correct Richard. Thanks for stating the obvious. The reason I get
the "undefined index.." error message is because IT DOES NOT EXIST. How does
this resolve my "session" problem?

Let me repeat - my code works with MS-IE 5.5 but not MS-IE6.

Pance.

"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello Pance,
>
> Tuesday, March 2, 2004, 11:45:49 AM, you wrote:
>
> P> and then I read the PHP manual and it suggested this instead:
> P>   session_start();
> P>   if (!$_SESSION['user_id']){ 
>
> P> which worked on my machine (Win98 and MS-IE5.5). But today I tried to
login
> P> to my page from the client's computer using MS-IE 6 and I got the
error:
> P> undefined index 'user-id'
>
> P> Does anybody know what's going on? Is there a bug with MS-IE6 when
using
> P> sessions?
>
> An undefined index error is PHP code related, not browser related.
> It's possible that the IE6 POST bug that is going around could cause
> it IF your error is the result of a page which takes form input from a
> user to build up that response.
>
> Your code is checking to see if the user_id element of the session
> array is false or not. Try checking to see if the element even exists
> or not before checking to see what it equals.
>
> --
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php