Jump to content

php session - local/remote access problem


popndekl

Recommended Posts

Hello guys,

 

slikasistema2ge2.th.png

 

I have 3 computers in a system (and 1 additional computer that accesses the system). Computer 1 is main computer in the system and should provide access to computer 2 and 3. When I log to computer 1 (php web page with login form and sessions) I have links to other 2 computers (might be more, all have php web page with login form). When link is clicked the session value is sent to computer 2 or 3 and new session is started on computer 2 or 3 so I don't have to login to computer 2 or 3 again.

 

It works fine when my computer is connected to the system from other IP family (remote access using router) and does not work when my IP family is the same as IP family of the system (no router is used).

 

When I'm locally connected to the system (example 2 - see picture) and I'm trying to access computer 2 or 3 automatic login seems to work. Session is started and set and everything look OK (session_start() is called and session is set - $_SESSION[mode]=something). But soon as I click anything on the page and function session_start() is called $_SESSION[mode] is empty. I can see that previous session stored in /var/www is empty and new one is created. It looks like session_destroy() is called (it is not) and session_start() called again.

 

So this login thing is not working with local access. When I access computer 2 and 3 directly (example 3 - see picture) login works and session is not lost/destroyed. I can browse page  without any problem.

 

Does anybody have any idea why remote access is working without any problems but it fails when I'm locally conected?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.