cookies

Accessing Cookies in Chrome Extension

柔情痞子 提交于 2020-01-04 06:43:28
问题 I'm trying to write a chrome extension that works with YouTube and need to access some of YouTube's cookie information. I cant seem to get my extension to see any cookies. (Even though I can see them under resources in the "Inspect Element" developer portion of Chrome). I'm pretty sure I've set up permissions correctly in the manifest 2 file because when I take out the "cookies" permission just to test it I get an error saying "Cannot call method 'getAll'". My current problem is just that no

Django cookies place double quotes around email address

坚强是说给别人听的谎言 提交于 2020-01-04 06:35:55
问题 On my login script it creates a cookie for the user logging in of their email address and password. Problem I am having is when the email address is set it puts the entire email address between double quotes. How would I get it to not? if request.method == 'POST': post = request.POST email = post.get('email', None) response.set_cookie('emailaddress', email, max_age=expire_v) 回答1: You can try strip method email.strip('"') 回答2: Another solution for this issue is to directly work with a

Python3, Requests: How to merge CookieJars

不想你离开。 提交于 2020-01-04 06:12:11
问题 I am learning Python and using the Requests Lib. I want to use a CookieJar to store cookies, but I cannot find out how to add a response's Cookies to an existing CookieJar: CookieJar.extract_cookies requires a request object - I dont understand which request to reference and why. I want to add the Cookies to a CookieJar, not to a request... So I tried cj= http.cookiejar.CookieJar() tmp= requests.utils.dict_from_cookiejar(resp.cookies) requests.utils.add_dict_to_cookiejar(cj, tmp) the third

Python3, Requests: How to merge CookieJars

半世苍凉 提交于 2020-01-04 06:11:57
问题 I am learning Python and using the Requests Lib. I want to use a CookieJar to store cookies, but I cannot find out how to add a response's Cookies to an existing CookieJar: CookieJar.extract_cookies requires a request object - I dont understand which request to reference and why. I want to add the Cookies to a CookieJar, not to a request... So I tried cj= http.cookiejar.CookieJar() tmp= requests.utils.dict_from_cookiejar(resp.cookies) requests.utils.add_dict_to_cookiejar(cj, tmp) the third

PHP Set and Read a Cookie String

。_饼干妹妹 提交于 2020-01-04 05:56:12
问题 I've got my form all completed, I know how to set a singular cookie using PHP however what is the best format to set a cookie string. I would like to have a cookie like so (or similar, my formatting is just an example); Prefs[theme=this&layout=that] How would I set a cookie like so and then get the information from my string? Code So Far: <?php if (isset($_POST['submitted'])) { $a = gmdate("M d Y H:i:s"); $b = "Cookies=true&Cookies_Accepted=" . $a . ""; $c = $_POST["APT_SELECTED"]; $d = $

Make cookies never expire with angularjs

僤鯓⒐⒋嵵緔 提交于 2020-01-04 05:41:26
问题 I am using angularjs cookies. https://docs.angularjs.org/api/ngCookies/service/$cookies I am using $cookies to store username and password. I know that is bad practice but put that aside for the moment. I want the user to log in once and never need to do it again unless the cookies are cleared. However, the problem is that after the chrome browser is closed, the user has to log in again next time he visits the web page because the cookies are no longer present. I want the cookies to never

Laravel Delete/Forget Cookie not working

风格不统一 提交于 2020-01-04 04:37:09
问题 How do you a delete cookies in Laravel. This is not working: public function logout(Request $request) { $this->guard()->logout(); $request->session()->flush(); $request->session()->regenerate(); Cookie::queue(Cookie::forget('cavpad')); Cookie::queue(Cookie::forget('cavuser')); return redirect('/'); } This works, but seems the wrong way to do it: Cookie::queue(Cookie::make('cavpad', '', 0, null, env('APP_DOMAIN'))); Cookie::queue(Cookie::make('cavuser', '', 0, null, env('APP_DOMAIN'))); Why

Sending cookies in request with crawler4j?

懵懂的女人 提交于 2020-01-04 04:24:08
问题 I need to grab some links that are depending on the sent cookies within a GET Request. So when I want to crawl the page with crawler4j I need to send some cookies with it to get the correct page back. Is this possible (I searched the web for it, but didn't find something useful)? Or is there a Java crawler out there who is capable doing this? Any help appreciated. 回答1: It appears that crawler4j might not support cookies: http://www.webuseragents.com/ua/427106/crawler4j-http-code-google-com-p

Asp.net vNext Cookie Authentication

谁都会走 提交于 2020-01-04 04:14:07
问题 Our website needs to authenticate against a third party webservice and create a cookie. We don't need to store the membership information. I have the following code in Startup.cs app.UseCookieAuthentication(options => { options.AuthenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.LoginPath = new PathString("/User/Login"); options.CookieName = "GEMSNCID"; options.ExpireTimeSpan = new System.TimeSpan(1, 0, 0); }); and the login method is var claims = new[] { new

How to retrieve cookies on a https connection?

試著忘記壹切 提交于 2020-01-04 04:07:16
问题 I'm trying to save the cookies in a URL that uses SSL but always return NULL. private Map<String, String> cookies = new HashMap<String, String>(); private Document get(String url) throws IOException { Connection connection = Jsoup.connect(url); for (Entry<String, String> cookie : cookies.entrySet()) { connection.cookie(cookie.getKey(), cookie.getValue()); } Response response = connection.execute(); cookies.putAll(response.cookies()); return response.parse(); } private void buscaJuizado(List