Jump to content

Strange problem with Sessions


w4r

Recommended Posts

Hello all, Im new to the forum.

I'm having an strange problem. I have a login system that works fine... the problem is:

 

1- u login to the system (checks username/password and makes the session)

2- u do something on the site (like posting a comment)

3- post is into the database

4- redirect (meta refresh) to somepage and HERE, the session is destroyed...  ???

 

u login again... do the same thing, and u dont get the session destroyed. obviously i dont have a session_destroy() there.. session should not be destroyed  >:(

 

since the codes are on different places i will try to take all the code out to copy it here.. but the problem doesnt seem to be the code.

i dont know... im really lost here.

 

 

Link to comment
https://forums.phpfreaks.com/topic/113519-strange-problem-with-sessions/
Share on other sites

Hello all, Im new to the forum.

I'm having an strange problem. I have a login system that works fine... the problem is:

 

1- u login to the system (checks username/password and makes the session)

2- u do something on the site (like posting a comment)

3- post is into the database

4- redirect (meta refresh) to somepage and HERE, the session is destroyed...  ???

 

u login again... do the same thing, and u dont get the session destroyed. obviously i dont have a session_destroy() there.. session should not be destroyed  >:(

 

since the codes are on different places i will try to take all the code out to copy it here.. but the problem doesnt seem to be the code.

i dont know... im really lost here.

 

 

 

damn... stupid problem

 

the problem was that i was using http://localhost, and i was using a meta refresh with http://192.blabla and it seems that it makes 2 different sessions

if you don't have session_start() on top of every page you need sessions to be used on then the session activity can't be retrived on that page and sometimes if you php.ini is configed in a certain manner the recycler can easily destroy that server side session data when the use navigates to a portion of your site not using sessions.

if you don't have session_start() on top of every page you need sessions to be used on then the session activity can't be retrived on that page and sometimes if you php.ini is configed in a certain manner the recycler can easily destroy that server side session data when the use navigates to a portion of your site not using sessions.

 

thanks but problem is already solved

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.