473,811 Members | 3,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session generation problem

Hi Group members !

We are hosting a Apache/PHP/MySql based website at our college since
January,2005. It was working fine since then. The web server is plaed
in our college itself and we are using IP binding method to make it
available globally.

We are having a login page which redirects the user again to home page
after authentication but with a session started. But the problem was
that every time the user enters his username and password, he was
redirected to home page but no session was genrated i.e. he is logged
in.

We tried to work out a solution for the problem but coudn't find one.
But to our surprise, the site started working normally on its own after
about 3 hours.

But yesterday, the same problem again surfaced and again we had no
solution. Thinking of past instance, we waited for many hours but the
problem sustained.
And still our site is affected with that problem.

The tecnical information :
Web server : Apache 2.0.52 Build Oct 15, 2004
PHP interpreter : PHP 4.3.9 Build Oct 20, 2004
Operating System : Linux Fedora Core 3

Can anyone suggest any solution or reference for the problem ?

Aug 24 '05 #1
4 1480
varungupta wrote:
Hi Group members !

We are hosting a Apache/PHP/MySql based website at our college since
January,2005. It was working fine since then. The web server is plaed
in our college itself and we are using IP binding method to make it
available globally.

We are having a login page which redirects the user again to home page
after authentication but with a session started. But the problem was
that every time the user enters his username and password, he was
redirected to home page but no session was genrated i.e. he is logged
in.

We tried to work out a solution for the problem but coudn't find one.
But to our surprise, the site started working normally on its own after
about 3 hours.

But yesterday, the same problem again surfaced and again we had no
solution. Thinking of past instance, we waited for many hours but the
problem sustained.
And still our site is affected with that problem.

The tecnical information :
Web server : Apache 2.0.52 Build Oct 15, 2004
PHP interpreter : PHP 4.3.9 Build Oct 20, 2004
Operating System : Linux Fedora Core 3

Can anyone suggest any solution or reference for the problem ?

Hi,

That is a really weird problem.
Next time you are unable to start session, do some testing.

Here are some things of importance to get a general idea.
I take it you store session in a temp-dir serialized (which is default
behaviour). If you use a database to store session, do something similar as
I decribed here to hunt down the bug.

0) Download Firefox as browser if don't have that already.
1) Thow away all your cookies.
2) Log into the system via the website as you always do.
3) check if a cookie is placed. It will have a name like: PHPSESSID and it
will contain a whole lot of random characters.
Note that string.
4) Look on the machine where PHP is running and check the temp-dir.
(You can find the temp-dir in php.ini, or when it is not set there: it is
the default tempdir, like /tmp)
5) Do you see a file in there with the same number-characterstring as the
cookie contained?

What do you find?

Regards,
Erwin Moller
Aug 24 '05 #2
varungupta wrote:

We are having a login page which redirects the user again to home page
after authentication but with a session started. But the problem was
that every time the user enters his username and password, he was
redirected to home page but no session was genrated i.e. he is logged
in.

We tried to work out a solution for the problem but coudn't find one.
But to our surprise, the site started working normally on its own after
about 3 hours.

But yesterday, the same problem again surfaced and again we had no
solution. Thinking of past instance, we waited for many hours but the
problem sustained.
And still our site is affected with that problem.


The default session handler does not scale well, although I suspect the
problem may lie elsewhere (permissions on session dir? disk space?).

Try using a MySQL session handler.

C.
Aug 24 '05 #3
Hi Erwin !

Its great to have reply from your side.
I have checked all the points mentioned by you and found that the
session is starting and cookies are generated on both server as well as
client side.
We have tried a test script to check session handling.
We started a general session by simply using session_start() and found
that the session was successfuly generated. We even stored and
successfully retrieved values on the same page but when we moved to
next page the session was not there, i.e. session was not continued on
next page.
Now please enlighten me.

Aug 24 '05 #4
varungupta wrote:
Hi Erwin !

Hi,
Its great to have reply from your side.
*blushes*
I have checked all the points mentioned by you and found that the
session is starting and cookies are generated on both server as well as
client side.
We have tried a test script to check session handling.
We started a general session by simply using session_start() and found
that the session was successfuly generated. We even stored and
successfully retrieved values on the same page but when we moved to
next page the session was not there, i.e. session was not continued on
next page.
Now please enlighten me.


Ok, always good to make a few simple scripts to test this. :-)

so: page1.php starts a session.
page2.php tries to read the session (without succes).

Try to add on page2.php some things like:
- echo session_id()
- dump all cookies print_r($_COOKI ES);

what do they say?

and maybe read up here (if you didn't do so already)
http://nl2.php.net/manual/en/ref.session.php
Last resort:
I had some (confusing) trouble with Sessions before, when using
session_start() .
I switched to 'session.auto_s tart' by modifying php.ini, and I never had
problems again. :-/
If you can modify php.ini, you could give that a try.
You can also delete all session_start() from your scripts then. :-)

Hope that helps a bit.
It is always difficult to debug a remote system. :P

Reagrds,
Erwin Moller
Aug 24 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
5299
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
0
2446
by: Rasmus Fogh | last post by:
Someone raised the question of automatic code generation a few weeks back. And yes, we (CCPN) are using automatic Python code generation in a major way. Basically we are making data models in UML, and using automatic code generation to make Python APIs, XML I/O etc. (more below). We can be found at http://www.ccpn.ac.uk/index.html As a general point, automtic code generation would seem like a good idea in special cases where:
4
2871
by: Kent Tegels | last post by:
Okay, so I know I'm doing two evil things: using Frames and storing stuff in Session. I'm a sinner and I'll repent after this project, I promise. But for now, I've got an interesting issue. In a site's Gobal.asax, I've written the following in Session_OnStart: Session.Add("Started",now.toString)
5
3552
by: Frank | last post by:
Our system maintains session state using the ASP.NET State Server service. We expect some of our session state objects to be over 85K, which categorizes them to be VLO's (very large objects) in terms of .NET memory allocations. This means that these objects will be allocated in a special managed heap for large objects. This makes sense since this would require some work for the garbage collector to move and compact these objects during a GC...
3
3660
by: Philip Tepedino | last post by:
I'm having an odd problem. My website's session state is getting shared between users! This problem only happens when a user tries to access the site from inside our corporate LAN. The user, instead of getting a unique session ID, gets somehow confused as another session and has access to all of the other session's info! I tried switching to cookieless sessions but that didn't make any difference. This is a huge problem for me, since my...
0
973
by: mark | last post by:
Code Generation 2007 Cambridge, UK May 18 - 20 2007 Web: http://www.codegeneration.net/cg2007/ Code Generation 2007 is a new event for software practitioners. The event will cover: Software Factories, Domain-Specific Languages (DSLs) and Domain-Specific Modelling,
9
1924
by: karthi84 | last post by:
hi, i have used session in my .net project. its version is 1.1, when ever i load that page i get the following error, Server Error in '/Alfi/invoice generation/WebApplication1' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated...
2
4420
by: =?Utf-8?B?YW5vb3A=?= | last post by:
Hello, I am developing a Simple ASP Application with a Login page. I want to know how session ID can be generated after User has authenticated instead of generation along with the Login page request. Also Session ID must be unique each time the user logs in. This is required so that Session Hijacking and Session Fixation could be prevented. Should I have to use other process instead of General ASP Session Management. Please Help Thank...
4
585
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I am getting the following error intermittently: "Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when Session state mode is 'StateServer' or 'SqlServer' " I have had this when trying to attach to a running process in debug when the components have not been jitted, but this error appeared in the release mode
0
9724
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10127
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.