Jump to content

Session Issues


cstr001

Recommended Posts

Hey guys,

 

I have quite a serious problem with my session variables on my website.

 

To give you the run down, I have four pages. The first is user selection in a form which via post method is passed into the normal;

 

$_SESSION['example']		= stripslashes(strip_tags($_POST['example']));

on the next page the form links to.

 

The following page has user details which again, put into a form and posted to the next page whereby the data is put into more session variables. I have run echo's at this stage to make sure the data is being kept.. This is done again on the third page ( I hope I haven't lost you here ).

 

Until, the last page is reached where there is NO code advising the session to be destroyed or anything.. all the session data apart except from the page before it, is lost. OK so I thought there might be some funky code on the 3rd page that might be doing something odd, I checked this by calling one of the variables previous at the very end of the page OUTSIDE of the HTML code. And the variable is returned.

 

The second that 3rd page goes into the last, the data goes.

 

So I wrote a bland last page just with a simple;

 

if (isset($_SESSION['example'])) 

to see if the variable is still there... negative.

 

I'm completely stuck and I've never had session data just disappear on me before so I need any help I can get. Am I going to have to end up using SQL to store the form data? Or can I just purely do it with sessions?

 

Cheers  :-[

 

 

Link to comment
https://forums.phpfreaks.com/topic/116376-session-issues/
Share on other sites

You know what - a couple of years back I wrote a huge web engine which included PHP session control.  About half way through writing it, strange stuff like that started to happen - session data just disappearing for no good reason.

 

I ended up writing my own session control class, and using mySQL to store the data.  After that, I had no more issues.  I've always said there is something wrong with PHP sessions.

 

Anyway, good luck with that!

Link to comment
https://forums.phpfreaks.com/topic/116376-session-issues/#findComment-598444
Share on other sites

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.