<?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: Using sessions in WordPress</title>
	<atom:link href="http://diovo.com/2009/10/using-sessions-in-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://diovo.com/2009/10/using-sessions-in-wordpress/</link>
	<description>Startups, Programming and stuff...</description>
	<lastBuildDate>Sun, 20 May 2012 07:14:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Robin C.</title>
		<link>http://diovo.com/2009/10/using-sessions-in-wordpress/comment-page-1/#comment-22302</link>
		<dc:creator>Robin C.</dc:creator>
		<pubDate>Mon, 02 Apr 2012 07:43:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=950#comment-22302</guid>
		<description>Thank you very much! This was very helpful for my own project too!

I needed to integrate WP in my own custom CMS because WP can&#039;t handle things that my CMS does. So I have WordPress handling the blog/news part of my site. Instead of my admins having to login twice (in my CMS and WP) they can now login one time in my CMS using the login/session structure of WP applied to my own CMS.</description>
		<content:encoded><![CDATA[<p>Thank you very much! This was very helpful for my own project too!</p>
<p>I needed to integrate WP in my own custom CMS because WP can&#8217;t handle things that my CMS does. So I have WordPress handling the blog/news part of my site. Instead of my admins having to login twice (in my CMS and WP) they can now login one time in my CMS using the login/session structure of WP applied to my own CMS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nitin</title>
		<link>http://diovo.com/2009/10/using-sessions-in-wordpress/comment-page-1/#comment-16407</link>
		<dc:creator>Nitin</dc:creator>
		<pubDate>Mon, 26 Dec 2011 10:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=950#comment-16407</guid>
		<description>Thanks Man, that worked for me.I wasted my full day googling around and finally got your article. But I am happy that finally it worked for me.. Just one question, you mentioned that Wordpress encourages to use cookies and not sessions, any specific reason for that?

Thanks,
Nixy</description>
		<content:encoded><![CDATA[<p>Thanks Man, that worked for me.I wasted my full day googling around and finally got your article. But I am happy that finally it worked for me.. Just one question, you mentioned that WordPress encourages to use cookies and not sessions, any specific reason for that?</p>
<p>Thanks,<br />
Nixy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lesa</title>
		<link>http://diovo.com/2009/10/using-sessions-in-wordpress/comment-page-1/#comment-6630</link>
		<dc:creator>Lesa</dc:creator>
		<pubDate>Fri, 26 Aug 2011 04:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=950#comment-6630</guid>
		<description>Thanks alot - your answer solved all my problems after several days srugtgling</description>
		<content:encoded><![CDATA[<p>Thanks alot &#8211; your answer solved all my problems after several days srugtgling</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: virgo</title>
		<link>http://diovo.com/2009/10/using-sessions-in-wordpress/comment-page-1/#comment-4998</link>
		<dc:creator>virgo</dc:creator>
		<pubDate>Sat, 16 Jul 2011 08:25:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=950#comment-4998</guid>
		<description>Well another reason of sessions not working properly could be a plugin.
Yes it is possible if you have two such plugins installed which are starting session at a same time and it can cause them to work improperly.
A few days back i was having the same problem running shopp plugin on my site and i was unable to checkout because of &quot;empty shopping cart&quot; error. there was something wrong going with session variables and it was unable to store cart items then after researching a lot , going through various forums and digging into this problem i came to know after 15 days of continuous frustration that it was my event-manager plugin which was creating all the problem, infact not whole plugin but the em-notices.php file inside classes folder. which was not in my use so what i did is just renamed that file and checked my site again and everything was working perfectly fine :)
so having two or more plugins starting session at the same time can cause problem in session variable</description>
		<content:encoded><![CDATA[<p>Well another reason of sessions not working properly could be a plugin.<br />
Yes it is possible if you have two such plugins installed which are starting session at a same time and it can cause them to work improperly.<br />
A few days back i was having the same problem running shopp plugin on my site and i was unable to checkout because of &#8220;empty shopping cart&#8221; error. there was something wrong going with session variables and it was unable to store cart items then after researching a lot , going through various forums and digging into this problem i came to know after 15 days of continuous frustration that it was my event-manager plugin which was creating all the problem, infact not whole plugin but the em-notices.php file inside classes folder. which was not in my use so what i did is just renamed that file and checked my site again and everything was working perfectly fine <img src='http://diovo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
so having two or more plugins starting session at the same time can cause problem in session variable</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rahul</title>
		<link>http://diovo.com/2009/10/using-sessions-in-wordpress/comment-page-1/#comment-4823</link>
		<dc:creator>rahul</dc:creator>
		<pubDate>Wed, 13 Jul 2011 16:25:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=950#comment-4823</guid>
		<description>Hi,
I am looking at various load content (video in this case)  &quot;once per session&quot;. Need help. Hopelessly hapless.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I am looking at various load content (video in this case)  &#8220;once per session&#8221;. Need help. Hopelessly hapless.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Quang Le</title>
		<link>http://diovo.com/2009/10/using-sessions-in-wordpress/comment-page-1/#comment-3240</link>
		<dc:creator>Quang Le</dc:creator>
		<pubDate>Fri, 13 May 2011 16:39:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=950#comment-3240</guid>
		<description>I recommend to use 

if (!session_id())
session_start();
}

It works for me.</description>
		<content:encoded><![CDATA[<p>I recommend to use </p>
<p>if (!session_id())<br />
session_start();<br />
}</p>
<p>It works for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kishore</title>
		<link>http://diovo.com/2009/10/using-sessions-in-wordpress/comment-page-1/#comment-2229</link>
		<dc:creator>kishore</dc:creator>
		<pubDate>Fri, 01 Apr 2011 07:39:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=950#comment-2229</guid>
		<description>function login_to_wp($u_name){
	require(&#039;wp-blog-header.php&#039;);
	$user_login = $u_name;
	$user = get_userdatabylogin($user_login);
	$user_id = $user-&gt;ID;
	wp_set_current_user($user_id, $user_login);
	wp_set_auth_cookie($user_id);
	do_action(&#039;wp_login&#039;, $user_login);
}

function logout_to_wp($u_name){
	require(&#039;wp-blog-header.php&#039;);
	$user_login = $u_name;
	$user = get_userdatabylogin($user_login);
	$user_id = $user-&gt;ID;
	wp_set_current_user($user_id, $user_login);
	wp_set_auth_cookie($user_id);
	do_action(&#039;wp_logout&#039;, &#039;&#039;);
}

login_to_wp($u_name);
}else{
logout_to_wp(&#039;&#039;);
}</description>
		<content:encoded><![CDATA[<p>function login_to_wp($u_name){<br />
	require(&#8216;wp-blog-header.php&#8217;);<br />
	$user_login = $u_name;<br />
	$user = get_userdatabylogin($user_login);<br />
	$user_id = $user-&gt;ID;<br />
	wp_set_current_user($user_id, $user_login);<br />
	wp_set_auth_cookie($user_id);<br />
	do_action(&#8216;wp_login&#8217;, $user_login);<br />
}</p>
<p>function logout_to_wp($u_name){<br />
	require(&#8216;wp-blog-header.php&#8217;);<br />
	$user_login = $u_name;<br />
	$user = get_userdatabylogin($user_login);<br />
	$user_id = $user-&gt;ID;<br />
	wp_set_current_user($user_id, $user_login);<br />
	wp_set_auth_cookie($user_id);<br />
	do_action(&#8216;wp_logout&#8217;, &#8221;);<br />
}</p>
<p>login_to_wp($u_name);<br />
}else{<br />
logout_to_wp(&#8221;);<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

