<?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>Java Interview Questions &#187; Cookies Interview Questions</title>
	<atom:link href="http://www.bestjavainterviewquestions.com/category/cookies-interview-questions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bestjavainterviewquestions.com</link>
	<description>Java Interview Questions &#124; Core Java Interview Questions &#124; Advanced Java Interview Questions &#124; EJB Interview Questions &#124; J2EE Interview Questions &#124; Hibernate Interview Questions</description>
	<lastBuildDate>Fri, 30 Jul 2010 06:00:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Cookie Examples</title>
		<link>http://www.bestjavainterviewquestions.com/cookie-examples-2/</link>
		<comments>http://www.bestjavainterviewquestions.com/cookie-examples-2/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 17:23:19 +0000</pubDate>
		<dc:creator>Ramakrishna</dc:creator>
				<category><![CDATA[Cookie Example]]></category>

		<guid isPermaLink="false">http://www.bestjavainterviewquestions.com/?p=286</guid>
		<description><![CDATA[2. Cookies It is sometimes necessary to use cookies for storing information on the client side. A cookie can be accessed from within an element, if the element definition contains an incookie or outcookie tag. An incookie is a cookie that can be read, and an outcookie can obviously be set. Let&#8217;s show how it [...]]]></description>
			<content:encoded><![CDATA[<p>2. Cookies</p>
<p>It is sometimes necessary to use cookies for storing information on the client side. A cookie can be accessed from within an element, if the element definition contains an incookie or outcookie tag. An incookie is a cookie that can be read, and an outcookie can obviously be set.</p>
<p>Let&#8217;s show how it works with a small example where we store the time when the user last visited a certain page. This is a typical real world example, and could be used for example to determine which news items are new since the last visit on a news site.</p>
<p>If we call our cookie last_visit and want to let the element NewsList get and set the cookie, the element definition would look like this:</p>
<p>Example 9.4. Defining an element with a cookie</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;!DOCTYPE element SYSTEM &#8220;/dtd/element.dtd&#8221;&gt;</p>
<p>&lt;element implementation=&#8221;NewsList&#8221;&gt;<br />
&lt;incookie name=&#8221;last_visit&#8221;/&gt;</p>
<p>&lt;outcookie name=&#8221;last_visit&#8221;/&gt;<br />
&lt;/element&gt;</p>
<p>Now that the element is allowed to access the cookie, we can write the Java code to read and write the cookie.</p>
<p>Example 9.5. NewsList.java: Using cookies from Java</p>
<p>package org.rifers.elephant.elements;</p>
<p>import com.uwyn.rife.engine.Element;</p>
<p>import javax.servlet.http.Cookie;<br />
import java.util.*;<br />
import java.text.*;</p>
<p>public class NewsList extends Element<br />
{<br />
public void showNews(Date lastVisited)<br />
{<br />
// Print new news items<br />
}</p>
<p>public void processElement()<br />
{<br />
Date date = Calendar.getInstance().getTime();</p>
<p>if (hasCookie(&#8220;last_visit&#8221;))<br />
{<br />
Cookie cookie = getCookie(&#8220;last_visit&#8221;);</p>
<p>try<br />
{<br />
Date last = DateFormat.getInstance().parse(cookie.getValue());<br />
showNews(last);<br />
}<br />
catch (ParseException e)<br />
{<br />
// Handle exception<br />
}<br />
}<br />
else<br />
{<br />
showNews(null);<br />
}</p>
<p>setCookie(new Cookie(&#8220;last_visit&#8221;,<br />
DateFormat.getInstance().format(date)));<br />
}<br />
}</p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.bestjavainterviewquestions.com/define-stateless-session/" title="Define Stateless Session"><img src="Array" alt="Define Stateless Session" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/define-local-interfaces/" title="Define Local Interfaces"><img src="Array" alt="Define Local Interfaces" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/difference-between-stateful-and-stateless-session-bean/" title="Difference Between StateFul and Stateless Session Bean"><img src="Array" alt="Difference Between StateFul and Stateless Session Bean" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/522/" title="Creating a Text file using Java"><img src="Array" alt="Creating a Text file using Java" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/making-a-frame-non-resizable-in-java/" title="Making a Frame Non-Resizable in Java "><img src="Array" alt="Making a Frame Non-Resizable in Java " /></a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.bestjavainterviewquestions.com/cookie-examples-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Define Cookie Poisoning</title>
		<link>http://www.bestjavainterviewquestions.com/define-cookie-poisoning/</link>
		<comments>http://www.bestjavainterviewquestions.com/define-cookie-poisoning/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 11:36:53 +0000</pubDate>
		<dc:creator>Ramakrishna</dc:creator>
				<category><![CDATA[Cookies Interview Questions]]></category>
		<category><![CDATA[cookie poisoning]]></category>

		<guid isPermaLink="false">http://www.bestjavainterviewquestions.com/?p=279</guid>
		<description><![CDATA[Q) What is cookie poisoning: A) The modification of or theft of a cookie in a user&#8217;s machine by an attacker in order to release personal information. If the cookie contains username and password, thieves can use their own computers and confiscated cookies to enter victims&#8217; accounts. See cookie. Random Posts]]></description>
			<content:encoded><![CDATA[<p><strong>Q) What is cookie poisoning:<br />
A) </strong>The modification of or theft of a cookie in a user&#8217;s machine by an attacker in order to release personal information. If the cookie contains username and password, thieves can use their own computers and confiscated cookies to enter victims&#8217; accounts. See <span style="font-size: small; color: green;"><em><a class="wp-caption" title="what to know about cookie" href="http://computerpreferedcourses.blogspot.com/" target="_blank">cookie</a>.</em></span></p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.bestjavainterviewquestions.com/difference-between-errortag-and-message-tag/" title="Difference between errortag and message tag"><img src="Array" alt="Difference between errortag and message tag" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/explain-briefly-about-serialization/" title="Explain Briefly about Serialization"><img src="Array" alt="Explain Briefly about Serialization" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/define-local-interfaces/" title="Define Local Interfaces"><img src="Array" alt="Define Local Interfaces" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/what-is-default-package-in-java/" title="What is Default Package in Java"><img src="Array" alt="What is Default Package in Java" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/difference-between-string-and-stringbuffer/" title="Difference between String and StringBuffer"><img src="Array" alt="Difference between String and StringBuffer" /></a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.bestjavainterviewquestions.com/define-cookie-poisoning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Define Cookies</title>
		<link>http://www.bestjavainterviewquestions.com/define-cookies/</link>
		<comments>http://www.bestjavainterviewquestions.com/define-cookies/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 11:09:10 +0000</pubDate>
		<dc:creator>Ramakrishna</dc:creator>
				<category><![CDATA[Cookies Interview Questions]]></category>
		<category><![CDATA[cookies]]></category>

		<guid isPermaLink="false">http://www.bestjavainterviewquestions.com/?p=275</guid>
		<description><![CDATA[Q) What is Cookies A) Cookies Definition:                                                                                                 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Q) What is Cookies</strong></p>
<p><strong>A) </strong><em>Cookies Definition</em>:                                                                                                                                       The <a class="wp-caption" title="know more about cookies click this" href="http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/Cookie.html" target="_blank">cookie</a> file is a file that resides on the client machine. It contains data passed from web sites, so that web sites can communicate with this file when the same client returns. The web site only has access to the part of the cookie file that represents the interaction with that particular web site. Clearly the cookie file has caused some issues with respect to privacy. Considering that as consumers, we do not know what information is being stored in the file, we should become concerned! The cookie file was first developed in order to help sites with the transaction process of the web. Without a cookie file, web sites are not able to track a single user&#8217;s path through a web site, thus a transaction that required multiple pages (as most do) would simply not be workable.</p>
<p><strong>Some Examples of Cookies Click here</strong>:<span style="font-size: small; color: blue;"> <a class="wp-caption" title="examples  of cookies" href="http://www.bestjavainterviewquestions.com/cookie-examples/" target="_blank">CookieExamples</a></span></p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li><a href="http://www.bestjavainterviewquestions.com/adding-a-database-driver-in-hibernate/" title="Adding a DataBase Driver in Hibernate"><img src="Array" alt="Adding a DataBase Driver in Hibernate" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/java-swings-interview-questions-2/" title="Java Swings Interview Questions"><img src="Array" alt="Java Swings Interview Questions" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/j2ee-interview-questions/" title="J2EE Interview Questions"><img src="Array" alt="J2EE Interview Questions" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/software-architecture-of-ejb/" title="Software  Architecture of EJB"><img src="Array" alt="Software  Architecture of EJB" /></a></li><li><a href="http://www.bestjavainterviewquestions.com/define-hashset-class/" title="Define HashSet Class"><img src="Array" alt="Define HashSet Class" /></a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.bestjavainterviewquestions.com/define-cookies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
