Guruji Point - Code You Want To Write

  • Home
  • Asp.Net
  • WCF
  • SQL
  • Type Script
  • AngularJS
  • Tech News
  • Blog
  • Earn Online

Friday, 29 July 2016

Cookies in Asp.Net

 No comments   

Cookies

A cookie is a small piece of text file stored on user's computer in the form of name-value pair.
Cookies are used by websites to keep track of visitors e.g. to keep user information like username etc. If any web application using cookies, Server send cookies and client browser will store it. The browser then returns the cookie to the server at the next time the page is requested. The most common example of using a cookie is to store User information, User preferences, Password Remember Option etc.


Type of Cookies

Persistent Cookies -   

 A cookie with no expiry time. Resides in your local file and can be accessed by web servers until they are deleted is called Persistent Cookies. Means these cookies are Permanent .
For Example :
Response.Cookies["Name_Your_Cookie"].Value = "This is a Persistent Cookie Example";
Response.Cookies["Name_Your_Cookie"].Expires = DateTime.Now.AddSeconds(10);

Non Persistent - 
A cookie with expiry time. Gets flushed when your browser is closed (Available only when browser is running) is called Non Persistent Cookie.
Response.Cookies["Name_Your_Cookie"].Value = "This is A Non Persistent Cookie.";

Points about Cookies-
 
1. Cookies are domain specific i.e. a domain cannot read or write to a cookie created by another domain. This is done by the browser for security purpose. 


2. Cookies are browser specific. Each browser stores the cookies in a different location. The cookies are browser specific and so a cookie created in one browser(e.g in Google Chrome) will not be accessed by another browser(Internet Explorer/Firefox)

3. Most of the browsers store cookies in text files in clear text. So it’s not secure at all and no sensitive information should be
 stored in cookies.
 

4. Most of the browsers have restrictions on the length of the text stored in cookies. It is 4096(4kb) in general but could vary from browser to browser.
 
5.
Some browsers limit the number of cookies stored by each domain(20 cookies). If the limit is exceeded, the new cookies will
 replace the old cookies
 

6. Cookies can be disabled by the user using the browser properties. So unless you have control over the cookie settings of the users
  

7. Cookie names are case-sensitive. E.g. UName is different than uname. User can delete a cookie.





  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to TwitterShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Facebook Updates

Guruji Point

Categories

comma seperated string in sql Comman table Expression in SQL Dynamic Grid Row IQueryable in c# Learn AngularJS row_number() and dense_rank() salary table structure. Scope_Identity() Use of indexes while loop in sql why do we need cursor why tuple used

About Us

This blog is about the Programming ,Tech News and some intresting facts related Contents. Here you can find fundamental and expert level topic of programming languages very practically related to C# , Asp.Net ,Sql-Server, JavaScript, Jquery, WebServices And also Web-Api, WCF ,WPF, Angular Js.

Contact Us

Email Us - gurujipoints@gmail.com
Contact- 8077657477

Reach Us

Copyright © Guruji Point - Code You Want To Write