cookies

How CURL Login with Captcha and Session

不打扰是莪最后的温柔 提交于 2019-12-31 09:49:04
问题 define('COOKIE', './cookie.txt'); define('MYURL', 'https://register.pandi.or.id/main'); function getUrl($url, $method='', $vars='', $open=false) { $agents = 'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16'; $header_array = array( "Via: 1.1 register.pandi.or.id", "Keep-Alive: timeout=15,max=100", ); static $cookie = false; if (!$cookie) { $cookie = session_name() . '=' . time(); } $referer = 'https://register.pandi.or.id/main';

Security loophole around password changes with .NET FormsAuthentication and persistent cookies?

一个人想着一个人 提交于 2019-12-31 09:45:10
问题 OK, here's a scenario: Bob logs into mysite.com, which uses .NET forms authentication, and ticks 'remember me'. Eve steals Bob's laptop Bob gets a new laptop, and changes his password. Now at this point, Eve has a stolen laptop, which has a persistent cookie stored on it, that will log her in to mysite.com as Bob - and, as far as I can tell, this will work even after Bob has changed his password . By default, the forms authentication cookie doesn't contain Bob's password (whether plaintext,

Why CSRF token should be in meta tag and in cookie?

纵然是瞬间 提交于 2019-12-31 08:29:29
问题 What's the need of to put CSRF token name and value inside <head> tag using <meta> like: e.g: <meta content="authenticity_token" name="csrf-param" /> <meta content="4sWPhTlJAmt1IcyNq1FCyivsAVhHqjiDCKRXOgOQock=" name="csrf-token" /> I've read about concept to keep CSRF value in cookie but does not find about why to keep inside <head> tag. 回答1: To prevent CSRF you need a value that is submitted with the request that cannot be sent by a malicious site. Authentication cookies are not suitable

PHP How to create a secure login system with cookies? [closed]

南笙酒味 提交于 2019-12-31 07:54:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am trying to create a secure login system using cookies. I have read a lot of articles and Stack Overflow questions on how to achieve that, but couldn't find anything usefull. Everyone is suggests different ways of achieving that, but those who seem reasonable and know what they are doing, I cant quite

Javascript cookie delete

本秂侑毒 提交于 2019-12-31 07:15:10
问题 If I create a cookie in Javascript document.cookie = 'unseen' how do I delete it when I navigate away from this page? This is the only cookie I am creating on the page. 回答1: Run this: document.cookie = 'unseen=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; You're not deleting it, but telling the browser it's expired so it'll delete it. 回答2: Set it it to expire to a time in the past. Function from http://techpatterns.com/downloads/javascript_cookies.php function Delete_Cookie( name, path, domain ) {

Setting a Cookie using only HTML5

怎甘沉沦 提交于 2019-12-31 07:04:46
问题 I found this article where it explains how to set a cookie using only HTML. He use http-equiv attribute on the <meta> in the <head> of an HTML document: <meta http-equiv="set-cookie" content="___________"> Now I have read about HTML < meta> http-equiv Attribute but I could not understand how to use it for set a cookie. Someone can explain to me if you can use this method for set cookie or that guide is just a joke? I tried this but HolidayGlaze cookie has not been saved. <meta http-equiv="set

Setting a Cookie using only HTML5

我的未来我决定 提交于 2019-12-31 07:04:16
问题 I found this article where it explains how to set a cookie using only HTML. He use http-equiv attribute on the <meta> in the <head> of an HTML document: <meta http-equiv="set-cookie" content="___________"> Now I have read about HTML < meta> http-equiv Attribute but I could not understand how to use it for set a cookie. Someone can explain to me if you can use this method for set cookie or that guide is just a joke? I tried this but HolidayGlaze cookie has not been saved. <meta http-equiv="set

Only show jQuery once per session

余生长醉 提交于 2019-12-31 05:36:28
问题 So I use the following code to show and fade an element. I have set the div on visible on the homepage and hidden on all other pages so the div only shows up on the homepage. My problem is, everytime I visit the homepage, the div will show up. Instead I would like to show the div only once per session. I've tried to fix it with cookies but it didn't work. $(window).load(function(){ $("#testlay").fadeIn('slow').delay(1000).fadeOut(1600); }); 回答1: You can use coockie for this take a look at

safari cookie issue

安稳与你 提交于 2019-12-31 04:26:06
问题 I am pulling my hair out on this. It works on chrome and Firefox but not in safari. What am I doing wrong? I am setting up a temp cookie and then check if it is set or not. When I clear all the cookies from safari, and then I run this file, it thinks that cookie is still there. here is the code setcookie("testcookie", 'cookiesetting temporary'); if(isset($_COOKIE['testcookie'])){ echo "cookie set": }else{ echo "no cookie set"; } In safari only, after disabling the cookies and removing all the

PHP Cookies works well on localhost, but it's not working on live server

不想你离开。 提交于 2019-12-31 03:27:06
问题 Note: This issue is already solved, finally I found that it's not cookies problem, the problem is on unserialize() function. The serialized cookie which being the parameter of that function must be stripslash-ed first. Hi there, I have a problem here about PHP Cookies. I'm using PHP Cookies to save user preferences. I've tested my code on my local machine (localhost using XAMPP). Everything's works very well, including the cookies. But when I uploaded it to the live server, the cookies not