<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP Session Data Lost Between [Some] Pages</title>
	<atom:link href="http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/</link>
	<description>Web Development and Strategic Communication</description>
	<lastBuildDate>Thu, 02 Feb 2012 05:11:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19620</generator>
	<item>
		<title>By: Charlie</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-959</link>
		<dc:creator>Charlie</dc:creator>
		<pubDate>Wed, 12 Oct 2011 17:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-959</guid>
		<description>Big thanks for that tip. I was struggling forever with why my sessions were being lost.  Lo and behold, if I commented out the 404 redirect in my .htaccess the problem went away.  Two issues I had there, first, my 404 redirect was going to the wrong path (needed to go to a sub-folder on the domain) and second, I must have had a wrong URL in my CSS or some other page that wasn&#039;t being found and was being sent to the incorrect 404 page, where the sessions were getting lost (because, I believe, that page didnt have a session_save path).</description>
		<content:encoded><![CDATA[<p>Big thanks for that tip. I was struggling forever with why my sessions were being lost.  Lo and behold, if I commented out the 404 redirect in my .htaccess the problem went away.  Two issues I had there, first, my 404 redirect was going to the wrong path (needed to go to a sub-folder on the domain) and second, I must have had a wrong URL in my CSS or some other page that wasn&#8217;t being found and was being sent to the incorrect 404 page, where the sessions were getting lost (because, I believe, that page didnt have a session_save path).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karan</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-953</link>
		<dc:creator>Karan</dc:creator>
		<pubDate>Thu, 15 Sep 2011 13:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-953</guid>
		<description>I just solved an issue where PHP session variables were being lost if I reloaded the page. The problem was a CSS file with an invalid URL. Once I fixed the href attribute of that LINK tag to point to the correct file, the issue went away. So CSS _can_ apparently affect PHP session variables. Must be some weirdness with the 404 response/headers or something.</description>
		<content:encoded><![CDATA[<p>I just solved an issue where PHP session variables were being lost if I reloaded the page. The problem was a CSS file with an invalid URL. Once I fixed the href attribute of that LINK tag to point to the correct file, the issue went away. So CSS _can_ apparently affect PHP session variables. Must be some weirdness with the 404 response/headers or something.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-933</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 02 Aug 2011 18:14:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-933</guid>
		<description>Thanks for this, I&#039;ve read of this being resolved by editing the setting in the php.ini file but this was not working for me. Setting the variable in the code works great.</description>
		<content:encoded><![CDATA[<p>Thanks for this, I&#8217;ve read of this being resolved by editing the setting in the php.ini file but this was not working for me. Setting the variable in the code works great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tristan</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-927</link>
		<dc:creator>tristan</dc:creator>
		<pubDate>Wed, 27 Jul 2011 17:43:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-927</guid>
		<description>Hey There, I appreciate the comment, but CSS would not affect your PHP code in any way. There must be something else going on in your case.</description>
		<content:encoded><![CDATA[<p>Hey There, I appreciate the comment, but CSS would not affect your PHP code in any way. There must be something else going on in your case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fadzlyothman</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-924</link>
		<dc:creator>fadzlyothman</dc:creator>
		<pubDate>Wed, 27 Jul 2011 07:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-924</guid>
		<description>It&#039;s the UI css that&#039;s causing the problem. Remove it and your session variables should be intact but there goes your styling. I had the same problem with datepicker UI but still have not found an answer..</description>
		<content:encoded><![CDATA[<p>It&#8217;s the UI css that&#8217;s causing the problem. Remove it and your session variables should be intact but there goes your styling. I had the same problem with datepicker UI but still have not found an answer..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tristan</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-897</link>
		<dc:creator>tristan</dc:creator>
		<pubDate>Mon, 23 May 2011 18:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-897</guid>
		<description>Thanks for the good info!</description>
		<content:encoded><![CDATA[<p>Thanks for the good info!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ionut</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-896</link>
		<dc:creator>Ionut</dc:creator>
		<pubDate>Mon, 23 May 2011 08:29:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-896</guid>
		<description>There&#039;s a cron job that deletes session data older than session.gc_maxlifetime. Changing the directory worked for you because the cron doesn&#039;t find the session data anymore, but I believe the right way to do this is to extend the session.gc_maxlifetime in php.ini.
Give it a try, end the voodoo misconceptions around loosing the session data.</description>
		<content:encoded><![CDATA[<p>There&#8217;s a cron job that deletes session data older than session.gc_maxlifetime. Changing the directory worked for you because the cron doesn&#8217;t find the session data anymore, but I believe the right way to do this is to extend the session.gc_maxlifetime in php.ini.<br />
Give it a try, end the voodoo misconceptions around loosing the session data.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mizo</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-850</link>
		<dc:creator>Mizo</dc:creator>
		<pubDate>Wed, 10 Nov 2010 20:13:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-850</guid>
		<description>Hey
i Sollved IT :)

and i posted that to make easy for every one searches on this issue
may be my sloution goes well with u  , may be not !

all i did is changing name of session that i play on

$_SESSION[&#039;type&#039;] changed to $_SESSION[&#039;Tipe&#039;] 

Hope that helps</description>
		<content:encoded><![CDATA[<p>Hey<br />
i Sollved IT <img src='http://www.tristanwaddington.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>and i posted that to make easy for every one searches on this issue<br />
may be my sloution goes well with u  , may be not !</p>
<p>all i did is changing name of session that i play on</p>
<p>$_SESSION['type'] changed to $_SESSION['Tipe'] </p>
<p>Hope that helps</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mizo</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-849</link>
		<dc:creator>Mizo</dc:creator>
		<pubDate>Wed, 10 Nov 2010 19:55:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-849</guid>
		<description>hello
thanks for ur help

but i tried ur tip and it doesnt work
if u have another solution plz publish it as i need it .

my session lost in certain page
any page else doesnt lose sessions</description>
		<content:encoded><![CDATA[<p>hello<br />
thanks for ur help</p>
<p>but i tried ur tip and it doesnt work<br />
if u have another solution plz publish it as i need it .</p>
<p>my session lost in certain page<br />
any page else doesnt lose sessions</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George</title>
		<link>http://www.tristanwaddington.com/2009/02/php-session-data-lost-between-some-pages/comment-page-1/#comment-20</link>
		<dc:creator>George</dc:creator>
		<pubDate>Wed, 20 May 2009 10:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.twaddington.com/?p=202#comment-20</guid>
		<description>Hi. Thanks for this!

I had the same problem and it was very frustrating due to the random and seemingly unpredictable nature of it. Sessions could last anywhere from 20 seconds to 20 minutes.

However in my case the server DID have a valid setting for save_path (it was simply &quot;/tmp&quot; which is quite a normal setting for linux servers) but I was still getting the random loss of session data. After setting the save_path to a local folder near my own home directory as you suggested, the problem went away.

So what causes the problem in the first place? It should be quite acceptable to store session data in temporary folders. It could be that the folder was being prematurely cleansed by some other process, but that wouldn&#039;t explain how, as you also mention, the session data would randomly disappear and then sometimes RE-appear! This to me indicates a file access problem, where the file is still there but unable to be read on occasion. I think that when it comes down to it, if the server is hosting a large number of sites, each of which is running potentially a large number of sessions simultaneously, it becomes a bit too much for the system when all of those processes need access to the same folder at the same time.

It would have been nice if I had received some kind of notification that the session data file could not be read, but hey, perhaps there is a log file somewhere I&#039;m not privy to. It&#039;s not my server after all.

Enough of my waffling! Thanks again for the tip :)</description>
		<content:encoded><![CDATA[<p>Hi. Thanks for this!</p>
<p>I had the same problem and it was very frustrating due to the random and seemingly unpredictable nature of it. Sessions could last anywhere from 20 seconds to 20 minutes.</p>
<p>However in my case the server DID have a valid setting for save_path (it was simply &#8220;/tmp&#8221; which is quite a normal setting for linux servers) but I was still getting the random loss of session data. After setting the save_path to a local folder near my own home directory as you suggested, the problem went away.</p>
<p>So what causes the problem in the first place? It should be quite acceptable to store session data in temporary folders. It could be that the folder was being prematurely cleansed by some other process, but that wouldn&#8217;t explain how, as you also mention, the session data would randomly disappear and then sometimes RE-appear! This to me indicates a file access problem, where the file is still there but unable to be read on occasion. I think that when it comes down to it, if the server is hosting a large number of sites, each of which is running potentially a large number of sessions simultaneously, it becomes a bit too much for the system when all of those processes need access to the same folder at the same time.</p>
<p>It would have been nice if I had received some kind of notification that the session data file could not be read, but hey, perhaps there is a log file somewhere I&#8217;m not privy to. It&#8217;s not my server after all.</p>
<p>Enough of my waffling! Thanks again for the tip <img src='http://www.tristanwaddington.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

