<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>what is session and cookies in php - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/what-is-session-and-cookies-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/what-is-session-and-cookies-in-php/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Wed, 03 Aug 2022 12:37:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>what is session and cookies in php - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/what-is-session-and-cookies-in-php/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is session in PHP ?</title>
		<link>https://www.wikitechy.com/interview-questions/php/what-is-session-in-php/</link>
					<comments>https://www.wikitechy.com/interview-questions/php/what-is-session-in-php/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Wed, 03 Aug 2022 12:37:58 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[how to get data from session in php]]></category>
		<category><![CDATA[how to set session in php]]></category>
		<category><![CDATA[php session login]]></category>
		<category><![CDATA[session and cookies in php]]></category>
		<category><![CDATA[session start in php]]></category>
		<category><![CDATA[session variable in php]]></category>
		<category><![CDATA[what is difference between session and cookies in php]]></category>
		<category><![CDATA[what is session and cookies in php]]></category>
		<category><![CDATA[what is session id in php]]></category>
		<category><![CDATA[what is session in php]]></category>
		<category><![CDATA[what is session in php how it works]]></category>
		<category><![CDATA[what is session start in php]]></category>
		<category><![CDATA[what is session_destroy in php]]></category>
		<category><![CDATA[what is the default session time in php]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4568</guid>

					<description><![CDATA[PHP session is used to store and pass information from one page to another page temporarily until the user closes website. In shopping website PHP website is widely used where we need to store and pass cart information from one page to another. For example. username, product code, product name, product price etc. The session [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">PHP session is used to store and pass information from one page to another page temporarily until the user closes website.</li>
<li style="text-align: justify;">In shopping website PHP website is widely used where we need to store and pass cart information from one page to another.</li>
<li style="text-align: justify;">For example. username, product code, product name, product price etc.</li>
<li style="text-align: justify;">The session creates unique user id for each browser to recognize the user and avoid conflict between multiple browsers.</li>
<li style="text-align: justify;">PHP session_start () function is used to start the session and starts new and resume existing session.</li>
<li style="text-align: justify;">If session is created already then it returns existing session and if session is not available, it returns and creates new session.</li>
<li style="text-align: justify;">It is an associative array that contains all session variables and it is used to get and set session variables.</li>
</ul>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4569 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session.png" alt="" width="1209" height="727" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session.png 1209w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-300x180.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-1024x616.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-768x462.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-390x235.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-820x493.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-1180x710.png 1180w" sizes="(max-width: 1209px) 100vw, 1209px" /></p>
<h2 id="syntax">Syntax</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php<br/>  <br/>           session_start();<br/>  <br/>            ?&gt;</code></pre> </div>
<h2 id="sample-code">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php<br/>                 session_start();<br/>                ?&gt;<br/>              &lt;!DOCTYPE html&gt;<br/>              &lt;html&gt;<br/>              &lt;body&gt;<br/><br/>              &lt;?php<br/>               // Echo session variables that were set on previous page<br/>                 echo &quot;Favorite color is &quot; . $_SESSION[&quot;favcolor&quot;] . &quot;.&lt;br&gt;&quot;;<br/>                 echo &quot;Favorite animal is &quot; . $_SESSION[&quot;favanimal&quot;] . &quot;.&quot;;<br/>              ?&gt;<br/><br/>            &lt;/body&gt;<br/>            &lt;/html&gt;</code></pre> </div>
<h2 id="output">Output</h2>
<p><img decoding="async" class="alignnone size-full wp-image-4570" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-example.png" alt="" width="1290" height="549" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-example.png 1290w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-example-300x128.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-example-1024x436.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-example-768x327.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-example-390x166.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-example-820x349.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/php-session-example-1180x502.png 1180w" sizes="(max-width: 1290px) 100vw, 1290px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/php/what-is-session-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
