Click here to Skip to main content
15,891,184 members
Everything / Cookie

Cookie

cookie

Great Reads

by V. Subhash
Use policies.json file to force Firefox to respect your preferences.
by Ekalaivan Chidambaram
About Cookie authentication events
by Thang Believe
Deep dive into cookies generation to support Remember Me at login
by nomi ali
In this article we learn MEAN Stack a combination of open source JavaScript framework. How they work and How can create a single page application using these technologies. We use these JavaScript technologies not only on front end but also on the back end.

Latest Articles

by V. Subhash
Use policies.json file to force Firefox to respect your preferences.
by Ekalaivan Chidambaram
About Cookie authentication events
by Prashant Rewatkar
There are multiple options to do authentication in .NET Core. This article demonstrates how to add cookie based authentication in .NET Core 3.0.
by nomi ali
In this article we learn MEAN Stack a combination of open source JavaScript framework. How they work and How can create a single page application using these technologies. We use these JavaScript technologies not only on front end but also on the back end.

All Articles

Sort by Score

Cookie 

29 Mar 2023 by V. Subhash
Use policies.json file to force Firefox to respect your preferences.
30 Jun 2021 by Ekalaivan Chidambaram
About Cookie authentication events
29 May 2014 by Thang Believe
Deep dive into cookies generation to support Remember Me at login
7 Dec 2023 by Richard MacCutchan
Take a look at Azure Web Application Firewall (WAF) v2 custom rules on Application Gateway | Microsoft Learn[^].
29 Mar 2021 by Richard Deeming
Use localStorage[^] instead of cookies. Cookies would be sent to the server with every request, and thus have a very small size limit. Local storage is never sent to the server (unless you write code to do so), so you can store much more data...
21 Aug 2014 by ZurdoDev
If you don't want the users to fill in the details again then tell your users to stop deleting cookies. They shouldn't be surprised that they have to enter the information again if they deleted the cookies.However, to be truly persistent don't use the cookies at all. Store the information...
31 Oct 2014 by kedar001
Sessions are stored in server memory, and sessions may/maynot use cookies to store something in the browser. Session is basically to identify a user in his security context. The web application uses session to identify whether the user is authenticated.. etc.So use session if you want to store...
22 Dec 2014 by Thomas Daniels
You don't need to store the password. You can follow these steps:When a user logs in and selects 'Remember Me', generate a unique (and complex) secret key for the user.Store this key in a cookie, and somewhere on your server (in a database for example). Make sure that you can check which...
20 Mar 2015 by F-ES Sitecore
Cookies are part of the http protocol for websites, they are not available from your windows forms app as the Request\Response objects are provided by the asp.net framework which allows your code to run inside the context of a web request. Your form is just an EXE running on the...
28 Jul 2015 by Suvendu Shekhar Giri
Make sure that you have added jQuery.Cookie to the script bundle. "~/Scripts/jquery.cookie.*"If not get it from hereNuGet | jQuery Cookie 1.4.0 [^]Hope, it helps :)
22 Sep 2015 by F-ES Sitecore
You can't hide things from these sniffing tools. If the text is sensitive you would need to encrypt it, but if it's a session id or similar then there isn't a lot you can do to protect it. That's why session hijacking is possible.
7 Dec 2023 by Andre Oosthuizen
This is not at all my field of expertise or even near there..., I did however found the question interesting and started some googling and, yes I know, some AI advise. It seems that your custom middleware for encoding and decoding cookies is...
3 Oct 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
1. You should read this nice article - ASP.NET session hijacking with Google and ELMAH[^]. See how Session can be hijacked.2. Also read the section "Parameter Tampering" - Hack-Proofing Your ASP.NET Applications[^]
22 Dec 2014 by Sinisa Hajnal
How about encrypting the password?Then you don't have to worry about it being visible. It will not prevent the user from accessing the site, only from knowing your password. If someone sets Remember me on a public (library? internet caffe) computer, well, tough luck.Encrypting passwords[^]
19 Mar 2015 by Joan Magnet
Take a look at reference's project. System.Web should be there.
22 Oct 2016 by LKC05
Is it possible that form authentication can work in asp.net without cookies? I have learnt some where that without cookies authentication work normally but with help of token in query string but when I am disabling cookies my form authentication is failing with message in browser "This page was...
22 Oct 2016 by Suvendu Shekhar Giri
While we don't know your code as you haven't shared yet but, you may like to start by reading some good articles on this and try to do the changes as described in following articles-Understand How the ASP.NET Cookieless Feature Works[^]How to get Cookieless FormsAuthentication to work with...
22 Oct 2016 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Yes you need configuration setting. Refer - How to get Cookieless FormsAuthentication to work with self-issued FormsAuthenticationTickets and custom UserData - Scott Hanselman[^].Quote:
6 Oct 2017 by ZurdoDev
You cannot update the cookies before the page finishes because they won't be sent back to the client until the page finishes. What you are asking is not making any sense. Perhaps you want to use a jqery ajax call instead of a page postback.
6 Nov 2017 by Richard Deeming
Cookies are not port-specific. There was a suggestion to add this feature back in 2000 in RFC 2695[^]; but that was replaced in 2011 by RFC 6265[^], which makes no mention of the port= attribute. AFAIK, no browser ever supported the Set-Cookie2 header or the port attribute. The closest...
26 Aug 2018 by Michael Haephrati
The following code[^] works with Microsoft Edge. It is not in c++ but you can learn from it how to do it. import win32inet cookie_string = cookie if cookie.find('xpires') == -1: expires = datetime.utcnow() + timedelta(days=30) expires_string = expires.strftime("%a, %d %b %Y %H:%M:%S...
18 Nov 2018 by Vincent Maverick Durano
Cookies are available via Request.Cookies collection. To read your custom defined cookies, you can simply do something like this: if(Request.Cookies["YourKey"]!=null) { var myCookie = Request.Cookies["YourKey"].Value; } For more information, refer the official documentation here: How to:...
27 Feb 2019 by Maciej Los
No, you don't. You have to add products to your cookie. HttpCookie MyCookie = new HttpCookie("YourCookieName"); MyCookie.Values["Product1"] = "Banana"; MyCookie.Values["Product2"] = "Orange"; MyCookie.Values["Product3"] = "Apple"; Response.Cookies.Add(MyCookie); Then you can access to...
20 Mar 2022 by OriginalGriff
Depends on the browser: Where are cookies stored in Windows 10 for all major browsers?[^] Do bear in mind that most browsers (every one I know of, anyway) stores them in an encrypted database, so finding the file probably won't help you ...
8 Dec 2023 by Maciej Los
I'd suggest to read these MSDN articles: Troubleshoot - Azure Web Application Firewall | Microsoft Learn[^] Examine WAF logs using Azure Log Analytics - Azure Application Gateway | Microsoft Learn[^] Policy settings for Web Application Firewall...
30 Jan 2024 by OriginalGriff
The Server doesn't. The Client does. Cookies are stored on the client machine by the browser under the current (Windows, Linux, Android or whatever) user - and since every user on a machine has separate data areas the browser stores it in the...
2 Apr 2014 by Maciej Los
anrorathod wrote:System saves the cookies in Internet Explorer, but it is not saving into Chrome and Firefox Browser.Above sentence is not informative at all. Nevertheless, you can find many useful information here: Using Cookies to Maintain Sessions in ASP[^]
8 Apr 2014 by dada2010
Hello,I've googling for 5 hours now and i become mad... if anyone have a idea it should be great.I'm using page method in my asp c# pages like this : [WebMethod] [System.Web.Script.Services.ScriptMethod] public static string GetUrl(string idSession) ...
12 May 2014 by Member 10683143
When I try to download the page as html the pages does not hold the session and takes you back to the login page. How do I pass the HttpCookie to the HttpWebRequest for validation?Or can it work with a session? The code works on a page that does not have a login session.I already created...
2 Jul 2014 by Rizwan 007 102
i just want to know where have been cookies stored and can we read it like user name and password?
9 Jul 2014 by Torakami
Hii,I have url for login page ..Now .. I am using cookiless session state .. so in my url i am geeting that session id ..so y problem is .. when i logout from the appication , login page displays same session id so in the url so i am unable to login with other credentials ..once...
21 Jul 2014 by Member 10839037
How make Cookie container in android?I found that in vb.net, in webclient inherits. is like this: * Private cookieCont As New Net.CookieContainer() Private lastPage As String Protected Overrides Function GetWebRequest(ByVal address As System.Uri) As System.Net.WebRequest ...
25 Jul 2014 by Sagar Shivdas Raut
hi i'm creating an application that have unity framework for dependency injection so my Account Controller is following and that contain Login Action public class AccountController : Controller { private readonly IUserService userService; public...
30 Jul 2014 by demoninside9
Hi all, There is a requirement for my web form. The application must implement proper session/cookie management on the server side, to ensure strict access control. this would avoid any user in directly copy-pasting of the link to get the unauthorized access into the...
30 Jul 2014 by Kumarbs
As per my understand, you are required different session Id's for each operation performed on the authentication. If it so, you can use "GUID" class to generate a random value and store it either in the cookie or session.
5 Aug 2014 by KergalBerlin
Hello community, In advance, please excuse my lack of knowledge regarding the following topic, I have tried to familiarise myself with the topic using both google and the search function. A friend of mine asked whether I could get data from a specific website for him, I answered "yes, I...
21 Aug 2014 by SandeepKushwah
Suppose there is page which asks user for his/her name,age etc. and save it into cookies. Now user is navigating on your website and in between he/she deleted all the cookies and then navigates to the other page which uses these cookies. According to me the next page will get blank values right?...
21 Aug 2014 by Enrique J. Gonzalez Fernandez
You can save it to a database and them load the data into a session variable.
3 Oct 2014 by Shemeemsha (ഷെമീംഷ)
How to send Cookies as URL parameter from one site to another site ..Likehttp://www.TestApplication.com?cookieValue=values
4 Oct 2014 by Member 10907223
My question: **What exactly is causing the program's request to be denied while the IE request is accepted?**Earlier today I was working on logging into E926 with an HTTPWebRequest and though all the other sites I tried worked just fine, I couldn't get this one working.. I changed...
8 Oct 2014 by Richard Deeming
You don't.Firstly, your C# code is executing on the server. It has no access to the other tabs in the same browser.Secondly, browsers explicitly prevent you from accessing cookies from other sites. This is an important security measure, and cannot be bypassed.
9 Oct 2014 by Stephen Hewison
Hi,I have a process implemented in an iFrame.The problem I have is this process requires a cookie to be written into the iFrame.I have no control over the iFrame content. The content is cross origin. The content is provided by a third party and does a number of posts/redirects to...
31 Oct 2014 by Member 11058791
I want to write a login code for e-commerce and university website in asp.net. Which method of login I should prefer. I want to continue login till user closes the browser. In this case I found difficult to manage with sessions. But I also want security.I think we can implement virtual session...
12 Nov 2014 by Santiago Fabian
I understand that is not possible to share cookies across totally different domains but if there is another alternative please let me know. My scenario is as following:On my web application there is one page (www.mydomain.com/somepage.aspx). When this page is visited, On Page Load, I do a...
12 Nov 2014 by Member 10690878
Hi I am facing a problem with my cascading dropdownlist as the below dropdownlist depending on a cookie "Location" value. The error message is: "No mapping exists from object type System.Web.HttpCookie to a known managed provider native type." if (!IsPostBack) ...
13 Nov 2014 by ashish__shukla
If I understand your scenario correctly you want to store the cookie that comes from one domain in page belonging to another domain.I think cookie is associated with a particular domain.HttpCookie has a property Domain which contains the domain of the cookie.I think you can try to set the...
22 Dec 2014 by carono
this is a 'remember me' login page . the html code is as below:
25 Dec 2014 by Karim Pazoki
I write code below but not set coockie!setcookie("uname", $_POST['usname'], time()+36000);can any one help me?
1 Jan 2015 by Member 11338387
I am interested in knowing if you have a solution to transfer the authentication of a WebBrowser control to a WebClient to download files using vb .net.My file to download something like...
8 Jan 2015 by abhishek chintaman
Hello CodeProject Team,I am facing a serious problem in my Asp.Net application while security testing it in Testing tool "Burp" for a ASLC point "Session Id and Session Cookie Path".I want to set Response.Cookies("ASP.NET_SessionId").value and Response.Cookies("ASP.NET_SessionId").path...
31 Jan 2015 by mohsen.keshavarzi
List listOfCountry = MyDataBase.Country.Liste.Complete;//get list of Country from databasecontrols.DropDownList.Bind(listOfCountry, ddlCountry );//binding list to ddlif (Request.Cookies["SelectedCountry"] != null){ string...
29 Jan 2015 by garfrey
I need to put jquery-cookie for function showHide(shID) do anyone know how to do that ? I got a onclick button to show more content , using function showHide(shID) but I just need to hide for once .So is it possible to add jquery-cookie for it ?how can I do that ?...
3 Feb 2015 by ENG.Samy Sammour
Hello i am trying to encrypt a cookie (name and value) and then restore its value i am trying this code but there is a problem its always get null.public class Auth{ public static string Lang { get { if...
11 Feb 2015 by Dinac81
I made a web application, and tested it locally. Everything worked fine so it was deployed to the hosting server. After a few weeks some of the users started to experience the "Object reference not set to an instance of an object" error. This is currently happening only in the chrome browser(on...
19 Mar 2015 by _Q12_
using System.Web;HttpCookie is not visible as a class.I can see [Cookie] class but its from (using System.Net);(and not from Web)What I miss?I use VS 2010. Maybe that's why I can not see the class?
24 Apr 2015 by teledexterus
Having trouble logging in in Internet Explorer 11. I am having a cookie problem. I need to clear the cache and cookies then enable the cookies.I have went to Tools>Internet Options>Privacy>Advanced checked "Override Automatic Cookie Handling", checked all "Accept" and checked "Always Allow...
28 Apr 2015 by Prakash J
my page is not working with cookies using javascript and url redirectingif userid/username(cookies) already in my browser, it comes thank for vote,otherwise it goes to login page..what is the problem in below code var...
13 May 2015 by Prakash J
how to create cookies with url,id,name using javascript and how to get saved cookie values( url,id,name) append each page(recently opened page) in my website
14 May 2015 by KRM
I have a site (that is Internet Explorer dependent) that sets two persistent cookies to DateTime.MaxDate (Dec 31, 9999). The two cookies are needed in requests to do mappings of customers to their respective data sources. When requests that need those cookies come in without those cookies, it...
17 Jun 2015 by E.F. Nijboer
You have several options. For example cookies can be used to store data between pages (or same page) even when refreshed. You only need to store the start time of the timer. You can calculate the time between from the current time minus the start time. So it will have the correct countdown...
18 Jun 2015 by Atanu Ghosh
I have an Image slider of 5 pics in Home page in a asp.net MVC application. Now when user will click on other tab within the application the last seen image of the image slider should be stored in session state. so when the user come back to the homepage,image slider will show the last seen...
20 Jun 2015 by Atanu Ghosh
I have an Image slider of 5 pics in Home page in a asp.net MVC application. Now when user will click on other tab within the application the last seen image of the image slider should be stored in session state. so when the user come back to the homepage,image slider will show the last seen...
20 Jun 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
First of all you need to identify that slider change event, by which image is getting changed.Inside that event, you can get the image which is displaying, because all other should be display none at that time. Then store it in cookie.
22 Jun 2015 by _Q12_
i can read the cookie from this page.I can see it in my textbox.How do I transmit to that page, my id and my password? or, how do i transmit the cookie? please help - i am stuck with this for more than 6 months and i cant figure it out. Please help me, im desperate. This is a winapp,...
23 Jun 2015 by Advay Pandya
Hello All,I am using my website inside IFrame from another website.Everything is working fine, but I am facing an issue with IE browser.Cookies are not getting saved in the IE browser. I tried with other browsers (Chrom, Firefox etc.) and it's working fine using same...
24 Jun 2015 by F-ES Sitecore
http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe-in-internet-explorer[^]
24 Jun 2015 by Advay Pandya
Hello All,Can anyone please advise me on this issue ?ThanksAdvay Pandya
8 Jul 2015 by Member 10690878
HelloInto my asp.net application there is a cookie called: " Location ". what i am looking for to do is in another page i want to pass this value and make the value is a page title in browser tab. (please note that i am using c#)Example of how the cookie value will look like into...
8 Jul 2015 by Azziet
set page title in second page by fetching the value from Cookiethis.Page.Title = "ABC - "+Request.Cookies["Location"].Value;
14 Jul 2015 by Advay Pandya
Hello All,I did some more research on this and got the solution. It's working now.@F-ES Sitecore: The link that you suggested is really helpful. ThanksPlease find the steps that I followed to sort out the issue:1) Generate p3p policy file. Please refer below link and follow the...
15 Jul 2015 by Leon Barkan
Hello i using selenium internetExplorer WebDriverWhen i trying to get cookies the driver shows me for example only 10 cookiesbut when i use the same website with FireFoxWebDriver i get all the 12 cookies.can i set some properties for the IE webDriver to get all the 12 cookies?Thank...
3 Sep 2015 by Member 11948190
I have a cookie "IMF" which has the UserID set and the expiration is "End of browsing session".I created a second cookie "LoginTime" and this cookie updates everytime the user changes pages.I set the LoginTime cookie expiration after 2min and assigned it to a variable. I want to use...
21 Sep 2015 by rashidebad
Hi.I am creating a http request in javascript which has a session cookie.I want to hide this cookie from web debugging tool like fiddler or any sniffing tool, How to achieve this ? Thanks
5 Oct 2015 by sagivasan
i have analytics.js (Universal Analytics). i need to get _utmz cookie for storing src, term ,medium ,campaign etc. its getting only _ga not _utmzi used utm alternative ( https://github.com/dm-guy/utm-alternative[^] ) but that providing only utmz campaign .pls tell me.. is there any...
5 Oct 2015 by Krunal Rohit
See this,How to store the object in cookie[^].And you can differentiate using the key of the cookie.-KR
15 Nov 2015 by SATHISH kumar
I try to login one website using C# HTTPWebRequest class, i can login but not able to read multiple set-cookies in headerWhen the server responds with multiple "Set-Cookie:"-headers, only the first one becomes available to me in headerWeb Response in HTTPWebRequest Set-Cookie:...
17 Dec 2015 by Sradhanjali Behera
Here is my function to unset cookie.function removeCookie() { //Logout var str = document.cookie; var username =...
17 Dec 2015 by Peter Leow
To remove a cookie, just set its expires parameter to a passed date:document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC";read more.[^]
13 Feb 2016 by Member 11146445
Hi,I developed a code to post username and password to a web server and get login, after that will read different page with same domain.i have enabled CookieManager but i dont know how to change the url.package com.example.sadeq.webloginprototypev4o;import...
18 Mar 2016 by OriginalGriff
Check your times: remember that the cookie is client based, so any expiration time will be relative to the local time on the client, while you are setting the expiration time relative to the local time on the server. If they are different by a couple of minutes that could cause the expiry. Or as...
16 Jun 2016 by Member 12000047
I am working on SAML 2.0. I have forms authentication enabled in IDP. When a authentication request is made from SP to IDP, the request is authenticated using forms authentication in IDP. IsAuthenticated is set to false in SP when i use...
1 Aug 2016 by Foothill
Here's how I have been managing the cookies in MVC[HttpGet]public ActionResult Details(){ HttpCookie cookie = new HttpCookie("MySiteCookie", "For the love of Pete, do not put unencrypted info in cookies!"); Response.SetCookie(cookie); return View();}[HttpPost]public...
1 Aug 2016 by Mankuji87
Cookies are one of several ways to store data about web site visitors during the time when web server and browser are not connected.check this useful resources about set cookie value in C#C# .NET: Get and Set Cookie Values in .NET[^]Cookies in ASP.Net C#[^]Cookies in ASP.Net C#[^]
5 Dec 2016 by Member 12888828
For a project I have to 1.Modify the web.xml to turn off the three test filter filters and turn on the LogResponsesCookiesFilter filter.2.Modify the LogResponsesCookiesFilter. The filter I implemented needs to add an additional cookie using the filter’s name as the cookie name. The content...
9 Jan 2017 by Dave Kreskowiak
It's saying it doesn't trust what you put in the cookie. So, what did you put in the cookie?
11 Jan 2017 by yunusarmutcu
Let my site be mysite.com. After users logged in mysite.com and then try visiting www.mysite.com they have to login again. Somehow url is regarded different with and without www.How can I read/write the same cookie for the urls with and without www?To solve this I set domain of my cookie...
11 Jan 2017 by F-ES Sitecore
Look at this link, you'll find others if you google "aspx forms authentication subdomain"c# - Forms Authentication across Sub-Domains - Stack Overflow[^]The trick is to change the "domain" of the auth cookie so that it matches anything that ends in your domain so that "www.domain.com"...
3 Mar 2017 by Member 11096176
I want to get all browser cookies without knowing any keys . My Intent is to performing or making an demo application which takes user's interest to target some ads.Is there faster way i can get keywords or cookies from Browser's I found way to get urls by reading history file but it is...
11 Mar 2017 by Peter Leow
Learn Servlets - Cookies Handling[^]
4 May 2017 by Arjun YK
Can anyone suggest me some link to understand google analytics cookies and ways to implement them in website? Thanks in advance What I have tried: I did try to browse through google analytics help, need much clear info of the same
21 Jun 2017 by Vinh Tran
Script at domain A fontend/views codeigniter: $(document).ready(function($) { $.ajax({ type: "POST", url: "http://domainB/setcookie.php", data:{ 'id': 'value' }, success: function(data){ ...
23 Jul 2017 by Atlapure Ambrish
The http context is not available in this event so you will not be able to access cookie. Instead you can use Application state and add userid to application variable once user is authenticated. Now, on session_end event you can fetch userid from application variable and set it to null in the...
14 Aug 2017 by Ken-in-California
I need to scrape a table of info from a site for which I have valid credentials - the owners of the site do not provide an API. I performed a login and saved the traffic with Fiddler, and am trying to replicate the key steps. I'm going to show the steps I've done so far, and get to where i am...
17 Oct 2017 by Kornfeld Eliyahu Peter
You can't. For security reasons you can not get all cookies only those related to your session/domain...
6 Nov 2017 by Christopher Fernandes
I have developed a employee leave tracking website using asp.net 3.5 which i am hosting through IIS 7.0 server on my company intranet. i have deployed the website twice for two seperate departments on same server so they have same ip address but port no 9696 & other on port no 9797 Now the issue...
1 Dec 2017 by Richie_W
I have written an MVC controller for a much larger web application that facilitates an SSO integration with a business partner using SAML 2.0. The users for web application must first authenticate against Active Directory before having access. The application simply pulls additional data from...
1 Dec 2017 by Richie_W
Thanks F-ES! That makes perfect sense. And thanks for the insight on browser behavior. I learned something new today. :)