Most voted "cookies" questions
Cookie, connection testimony, or simply testimony is a group of data exchanged between the browser and the page server, placed in a text file (file) created on the user’s computer. Its main function is to maintain HTTP session persistence.
Learn more…173 questions
Sort by count of
-
31
votes2
answers5413
viewsWork with Session without cookies to prevent session theft
When the session is started, it creates a cookie with PHPSESSID, making the ID public. Knowing that to prevent session hijacking it is best to hide the session ID from other users, then PHPSESSID…
-
29
votes2
answers3910
viewsWhy is it important to inform users of the cookie policy?
I’ve been browsing several websites that in their headers show messages like: This site uses cookies to improve your navigation. By browsing the site you consent to its use. It’s okay that cookies…
cookiesasked 7 years, 5 months ago Felipe Duarte 6,284 -
26
votes3
answers8116
viewsHow does the session work in web browsers?
A session allows, for example, that I allow the user to remain logged in, saving the information of who is logged in (username, for example). I believe it’s something more elaborate than cookies,…
-
17
votes2
answers13586
viewsUse of $_REQUEST instead of $_GET, $_POST and $_COOKIE
In PHP we have available the global variable $_REQUEST which can be used instead of using the global variables individually $_GET, $_POST and $_COOKIE. For example: <?php // utilizar $bubu =…
-
16
votes2
answers240
viewsHow do I serve a site in multiple languages in Apache?
I’m developing a website that needs to be available in 3 languages (only static content, to be served by Apache). I would like to make use of the language detection features so that the user already…
-
12
votes1
answer4268
viewsHow to get any kind of cookie using Selenium?
Summary To summarize everything I said here below, I need to open Whatsapp Web read the QR Code and save cookies so that at the next Selenium startup I do not need to read the QR Code again. I found…
-
11
votes4
answers12823
viewsHow to make a countdown with javascript?
Hello guys I don’t understand practically anything Javascript, so for weeks I was trying to make a script that did the following: 00:00:00 1º start a countdown of 20 minutes after clicking a link.…
-
10
votes1
answer361
viewsPassport Session authentication on Android
I have a web app running with Nodejs, Express and Passport-JS authentication, and everything works perfectly. Now I’m developing an Android app and need to authenticate my users using the same API.…
-
10
votes2
answers2429
viewsWhat is the logic behind the "days * 24* 60* 60* 1000"?
Reading some things about cookies, always observe the calculation dias * 24* 60* 60* 1000 What is the logical reasoning behind this?
-
9
votes3
answers447
viewsPrevent cookies from being viewed/obtained with javascript
I was reading an article and I found curious a sentence of this, where the author makes a list (right in the first paragraphs of the article) of the main safety care that we developers should take…
-
8
votes1
answer3210
viewsMaximum number and size of cookies
When investigating about cookies and their limitations, I came across this Microsoft page where they talk about Internet Explorer and its capabilities regarding Cookies: Size and number limits of a…
-
8
votes1
answer348
viewsCollapse Menu after page refresh with localStorage
How can I close a menu and keep it closed after the refresh of the page using jQuery only? It would be something like at this link. By clicking the button the menu is reduced and remains so even…
-
8
votes2
answers1213
viewsWhat are the advantages and disadvantages of storing session variables in the database?
From Rails 4.0, was eliminated the Activerecord Session Store, that kept session variables in the database, for "performance issues." But the functionality continues to work through a Gem. Today…
-
7
votes1
answer462
viewsUsing Cookies or Databases?
I need to create a cart where you store more than one data Example: ID_PRODUTO, ID_VENDEDOR I would like to use Cookies pro system get lighter, but I found a big problem, the Cookie stores the data…
-
7
votes5
answers7569
viewsHow to delete COOKIES in PHP?
How can I delete COOKIES in PHP? I know that for sessions you have the session_destroy() but for Cookies how do I?
-
7
votes2
answers2701
viewsWhich is more secure: Session or cookie?
Thinking about security guard, what is the best option to keep the user logged in an ASP.NET MVC application, the cookie or the Session?
-
6
votes1
answer4629
viewsOption "keep connected" / "remember me" on login screens
I am implementing a login screen and my client asked to add a checkbox "Keep logged in" below the login credentials. Okay, adding is easy. But what is the correct behavior for this feature? Is there…
-
6
votes2
answers2609
viewsRun function only once after site loading
A friend passed me a script of a box that opens when someone enters the site, however, when updating the page it appears again. You could help me? Below the code: function timer() {…
-
6
votes3
answers810
viewsRecord Javascript session using cookie and button
I set up a banner, where I need that when the user enters the site and clicks on the GOT IT button it disappears and when the user re-enters the site or loads another link no longer appears.…
-
5
votes1
answer888
viewsPHP (setcookie) vs header (header )
I see some frameworks, CMS and the like, writing cookies directly in PHP with setcookie and others stock to send us headers at the end of the run. I wanted to know how to create a pattern for the…
-
5
votes1
answer1209
viewsIs there any way to access a cookie from a different domain?
Is there any way I can access a cookie from a different domain? For example: there is a cookie on facebook.com.br and I want to access cookie data within my site www.fulano.com.br .
-
5
votes2
answers1316
viewsMonitor PHP script processing
Does anyone know a way to monitor PHP code processing and present to the client? I’m designing a converter layout which takes data files in a given format and converts to another format. Basically,…
-
5
votes1
answer3871
viewsLocal Storage or Cookie, where is it best to store an authorization token?
We have a project and we will use a token de autorização, we’re using AngularJs to the front end and the back we develop in Java using Spring Framework and Spring Security, and send the token for…
-
5
votes1
answer775
viewsCatch event click inside iframe with jQuery
I’m using the Google Forms to do a satisfaction survey on a site. On this site I show a bar at the top, asking the user to participate. If he closes the message, a cookie is saved that expires in 24…
-
5
votes1
answer229
viewsCurl cookies expires vs n/a
The doubt is as follows, in the network browser console says cookies do not expire, see the image below: But when picking up (making a request of these) these cookies with curl expire:…
-
4
votes2
answers1015
viewsHow to make a request by sending cookie data?
I want to file a requisition GET for a particular URL, but I want to send cookie data, as a web browser does. For example, in the code below: from urllib import request req =…
-
4
votes1
answer5307
viewsHow to work a secure session in PHP using cookies so that the session does not expire when you close your browser?
In PHP, I usually work on user authentication in a restricted area using the variable $_SESSION, but I want to change this method to cookies so that the session does not end when closing the…
-
4
votes3
answers2517
viewsHow does Youtube know which videos we’ve watched?
The question itself already describes my interest, but what I’m really wanting to know is how youtube stores the information saying that we’ve already watched that video. I thought about storage…
-
4
votes0
answers687
viewsThe time of Cookies created when I close my browser is running out
I’m here asking because unfortunately I’ve tried all the alternatives in research since last week. And I’m probably doing something wrong. Come on: setcookie("email", "email", time() + (360 * 24 *…
-
4
votes3
answers1686
viewsIs saving the user ID in COOKIES safe?
Guard the ID of the user in Cookies is safe as it is easy to see it from the browser. My questions are as follows:: Guard the ID of the user in Cookies is safe? If it’s not safe, what method seguro…
-
4
votes2
answers2173
viewsHow to log into Facebook using an active session cookie in the DOM?
I’m studying security in web applications. For educational purposes, I logged on to my Facebook page and copied my active session cookie obtained on document.cookie, then I opened another browser,…
-
4
votes1
answer2041
viewsHow to set cookies and set expiration time?
I am with a div where I search only logged in users, in it I am displaying users but each update is inserted new records, gave me the tip to use cookise more never worked with it. the following code…
-
4
votes1
answer151
viewsProblems to display cookies
I have a Cookie set with the name 68 and value 68, it appears in the settings of cookies in the browser, but in pages it works and in others it simply does not exist $id_imovel =…
-
4
votes1
answer744
viewsWhat are the dangers of keeping the Oauth2 token on the frontend?
I believe I am paranoid, but I could not find any situation similar to mine (if you know pass me the link, I am grateful) so I wanted to ask this question to get a definitive answer. Before the…
-
3
votes1
answer683
viewsGet cookies from an Httpclient login on android
I do a post with android and Httpclient on a page, but I need to know a way to get cookies from that connection. this is the code I use to make the post public static void postData(Activity…
-
3
votes2
answers1312
viewsRetrieve cookie expiration time in javascript or jquery
Is there any way to recover the remaining time for expiration of a javascript or jquery cookie?
-
3
votes2
answers3905
viewsHow to delete all Cookies from a Javascript page?
There is a way to delete all (existing) cookies related to a page, using Javascript only?
-
3
votes3
answers630
viewsIndications of use of cookies?
What would be the indication to use cookies? They would be a IsolateStorage web development, but so far I could not find an application for them, in a social media project I am working I used them…
-
3
votes2
answers581
viewsUse Cookie or Localstorage?
I was developing a plugin for jQuery and needed to store some information. I thought I’d use the localStorage of HTML5, but I was warned by a friend that in some older versions of browsers would not…
-
3
votes1
answer87
viewsHow to enable cookies in Electron
I need to use http only cookies on Electron, but they are disabled someone knows how to enable?
-
3
votes1
answer1095
viewsBest practices for a login system Sessions/Cookies
I would like to know some important points when making a login system: Sessions x Cookies Which is the most appropriate in security matters? Which uses the least server resources? (case in a large…
-
3
votes1
answer35
viewsControl daily image views
I don’t want the script ready, just know the best strategy. Guys, I’m having a hard time figuring out how best to control the amount of daily banner views. For example: I have a comic with 500…
-
3
votes1
answer222
viewsRandom site theme with exchange every 30min
I am needing my site to change the theme randomly every 30 min. So the logic would be: User enters the site now and views it in blue color (which is the default), but if this same user comes back in…
-
3
votes0
answers1140
viewsWhat is the difference between Local Storage, Session Storage and Cookie?
What’s the difference between Local Storage, Session Storage and Cookie? What is the purpose of each of them and what differentiates them?
-
3
votes2
answers1345
viewsHow to store and retrieve the previous URL within the Cookie
The whole script is in the bookmarks/bookmarks bar, named: Bookmarklet I’ve already drawn up the script. Behold: Before c/ referrer javascript: var URL = document.referrer; location.href = URL; Now…
-
3
votes1
answer123
viewsHow to know if the person has visited another site with cookies?
Example, I have 2 different domains, I would like to know with cookies if he has visited before, or if ever clicked on certain thing on my other site, ie if he has visited my site before, clicked on…
-
3
votes1
answer71
viewsCookie returning duplicate value
I am cookie saving an object in JSON format. In the properties of this object I have links with several parameters. With each link change, I update the cookie with the new value. Example of the…
-
3
votes0
answers77
viewsAre web security standards insufficient?
Well, above all, in addition to the issue I will raise here, I would also like to raise a debate, the security standards for system authentication are not insufficient? Context of the problem: I…
-
3
votes2
answers223
viewsCookie and sharing between subdomains?
I have a website with the following address http://www.mysite.com.br that in programming back-end is created some cookie settings and even information with encrypted data. A subdomain has now been…
-
2
votes3
answers1664
viewsHow to use a Cookie as an Array in Javascript?
Doubt: I would like to know a way to use a Cookie, as if it were a Array. Problem: I can’t imagine how to do that. Example: Suppose I have one Array called Foo which would be as follows: var Foo =…