Re: Sessions, sessions and... sessions
| From: | Pance | Date: | Tue, 02 Mar 2004 12:14:36 +0000 |
| Subject: | Re: Sessions, sessions and... sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-179231@lists.php.net to get a copy of this message | ||
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" <hpuiu@oxygensoftware.ro> wrote in message
news:20040302111304.94252.qmail@pb1.pair.com...
> 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.