cookies

How to scrape page requiring cookies and javascript in PHP

人盡茶涼 提交于 2020-01-05 11:02:52
问题 Is there an easy way to emulate cookies and javascript with a php script scraping a web page requiring it? The current response shows: <body><noscript>This site requires JavaScript and Cookies to be enabled. Please change your browser settings or upgrade your browser.</noscript></body> I put this in the code and it made no difference: $strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/'; curl_setopt( $ch, CURLOPT_COOKIE, $strCookie ); 回答1: HTML inside the <noscript> </noscript> will

Javascript Checkbox cookie

為{幸葍}努か 提交于 2020-01-05 10:06:23
问题 On my php form with random number of checkboxes (depends on MySQL query results) i use pagination and checkbox_cookie.js script to remember checkboxes values from other subpages. It works well if there is less then 200 checkboxes after that it's loosing memory of last checkbox changes e.g. i have 230 checkboxes spllited in 8 subpages it remember positions for those in 7 sub-pages but can't save states of checkboxes at page 8. And now i'm seriously out of clue why is it happening. Is it cookie

Javascript Checkbox cookie

别来无恙 提交于 2020-01-05 10:05:04
问题 On my php form with random number of checkboxes (depends on MySQL query results) i use pagination and checkbox_cookie.js script to remember checkboxes values from other subpages. It works well if there is less then 200 checkboxes after that it's loosing memory of last checkbox changes e.g. i have 230 checkboxes spllited in 8 subpages it remember positions for those in 7 sub-pages but can't save states of checkboxes at page 8. And now i'm seriously out of clue why is it happening. Is it cookie

how to identify a cookie is from client-side or server-side?

孤街醉人 提交于 2020-01-05 09:05:27
问题 how does the browser differentiate a cookie is from client-side created (JavaScript) or server-side created (ASP.NET). Is it possible to delete cookie created from server side in client side and vice versa, I'm struggling to delete a cookie was created from client-side using javascript in ASP.NET code-behind. 回答1: how does the browser differentiate a cookie is from Client side(javascript created) or serverside created (Asp.net). It doesn't. A cookie is a cookie. The closest it comes is the

Python automating a wget script with login required

房东的猫 提交于 2020-01-05 08:09:12
问题 I need to automate a download process from a site which requires the following: send an HTTP POST request containing your username and password I should get a cookie (probably containing a session ID) send an HTTP GET request for the file, sending my cookie details in the HTTP headers Using wget now, I must first login with a password (open a session?) : wget --no-check-certificate -O /dev/null --save-cookies auth.rda_ucar_edu --post-data=email=name@domain.edu&passwd=5555&action=login https:/

cookie to remember dropdown selection

人走茶凉 提交于 2020-01-05 07:55:17
问题 I have a simple dropdown and user selects a choice and the page refreshes with the selection added to the URL as a querystring. But i want to also keep the selected state of dropdown after the refresh. How do i do that using jquery or cookie? <select id="MyDropDown" onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option value="http://mysite.com/default1.aspx?alpha=A">A</option> <option value="http://mysite.com/default1.aspx?alpha=B">B</option> <option value="http:/

Deleting Cookies In Other Subdomains

隐身守侯 提交于 2020-01-05 07:23:17
问题 I was wondering if it's possible to delete a cookie in PHP, meaning re-setting it's time to a time in the past, for a specific subdomain from another subdomain. For example: say I am executing the following code on one.myserver.com, which is meant to delete a cookie on two.myserver.com setcookie("ACOOKIE", 0, time() - 3600, "/", "two.myserver.com"); Currently doing it this way is not working for me. Is there any way I could get something like this to work? 回答1: Nope, you can only do that from

Loosing cookie when swich from http to https

ⅰ亾dé卋堺 提交于 2020-01-05 06:49:26
问题 I have the option in my site to change language. When user change language ,its saved in cookie, so the other pages know which language to display! Some of the pages are in https. And in these pages I don't get the selected language. Is there any way to use the same cookie for http and https ? 回答1: No, there isn't. The cookies are local to the domain, and the http and https pages are considered to be in different domains. The https pages are encrypted, so sending the same cookies for a http

how to check from JavaScript if loaded page has ASP.NET authentication cookie?

柔情痞子 提交于 2020-01-05 06:43:34
问题 It looks like JavaScript does not have access to authentication cookies ('ASP.NET_SessionId', '.ASPXFORMSAUTH') in the http headers I can see cookies but document.cookie object does not have them. 回答1: ASP.NET session cookies are HTTP-only by default (and rightfully so). If you need to find out if the user is authenticated in Javascript, putting a HiddenField on the page and setting its value to 0 or 1 based on your authentication token is a much better solution. 回答2: You could create a

how to check from JavaScript if loaded page has ASP.NET authentication cookie?

て烟熏妆下的殇ゞ 提交于 2020-01-05 06:43:30
问题 It looks like JavaScript does not have access to authentication cookies ('ASP.NET_SessionId', '.ASPXFORMSAUTH') in the http headers I can see cookies but document.cookie object does not have them. 回答1: ASP.NET session cookies are HTTP-only by default (and rightfully so). If you need to find out if the user is authenticated in Javascript, putting a HiddenField on the page and setting its value to 0 or 1 based on your authentication token is a much better solution. 回答2: You could create a