cookies

difference between cookie and string in request header

吃可爱长大的小学妹 提交于 2020-07-08 09:39:05
问题 Cookie is nothing but a small piece of information most of the times a string in the request header send by the client to server. If i add one more string to the request header at server in java like conn.addRequestProperty("iPlanetDirectoryPro", token); then is there any difference between the two? Can the second one be also considered as a cookie. Regards, Maclean Maurice Pinto 回答1: You'll want to read the HTTP specification (message headers) and the HTTP State Management specification. The

How do I send cookies with request when testing Flask applications through nosetests?

主宰稳场 提交于 2020-07-06 09:13:06
问题 I'm having some trouble sending a cookie with my test request. I've tried something like this: # First request to log in, retrieve cookie from response response = self.app_client.post('/users/login', query_string={ data.. ) cookie = response.headers['Set-Cookie'] # Contains: user_hash=3f305370487731289a7f9bd8d379a1c2; Domain=.flowdev.com; Path=/ # Second request that requires the cookie response = self.app_client.get('/users/', headers={'Set-Cookie': cookie}) # Here i print out request

ASP.net core auth cookie not being set in Google Chrome when running in dev

核能气质少年 提交于 2020-07-05 05:37:09
问题 I have three applications in my solution, all built in asp.net core 1 MVC 6. App 1 is an MVC app used for authenticating a user. App 2 is an Angular SPA app and is the main app in the solution. App 3 is an MVC web api application. In app 3, I have the usual asp.net core SignInManager and UserManager code (the same code as you get by default when you start a new MVC 6 template - only different is, it exists in my web api here). And the login/logout/register etc is exposed via web api methods

React frontend and REST API, CSRF

白昼怎懂夜的黑 提交于 2020-07-04 05:25:31
问题 Using React on the frontend with a RESTful API as backend and authorisation by JWT, how do we handle sessions? For example after login, I get a JWT token from REST. If I save it to localStorage I am vulnerable to XSS, if I save it to cookies, same problems except I set cookies to HttpOnly, but React can't read HttpOnly Cookies (I need to read cookie to take JWT from it, and use this JWT with REST requests), also I didn't mention CSRF problem. If you're using REST as backend, you can't use

Not able to read complete cookie in perl

天大地大妈咪最大 提交于 2020-07-03 13:01:41
问题 I am receiving below cookie from my source system ExternalAccess=unixtime=1593603710&oracletime=01-jul-20 12:41:50_Hash_thNnmggU2ex3L5XXeMNfxf8Wl8STcVZTxscSFEKSxa0 At destination system [PERL based], using below code to read the cookie my $extSysCookie = $Query->cookie('ExternalAccess'); i am getting below output External Access cookie = unixtime=1593603710 and not able to read full value.All characters after & are getting omitted. Can anyone help? 回答1: First of all, that's not a valid cookie

Not able to read complete cookie in perl

旧城冷巷雨未停 提交于 2020-07-03 13:01:29
问题 I am receiving below cookie from my source system ExternalAccess=unixtime=1593603710&oracletime=01-jul-20 12:41:50_Hash_thNnmggU2ex3L5XXeMNfxf8Wl8STcVZTxscSFEKSxa0 At destination system [PERL based], using below code to read the cookie my $extSysCookie = $Query->cookie('ExternalAccess'); i am getting below output External Access cookie = unixtime=1593603710 and not able to read full value.All characters after & are getting omitted. Can anyone help? 回答1: First of all, that's not a valid cookie

Standard for storing session key

我与影子孤独终老i 提交于 2020-06-29 03:52:55
问题 After doing a bit of research on this topic, it seems like session keys have typically been stored as cookies which is nice because they get automatically added to requests. I've been seeing that developers prefer localstorage to cookies due to less restrictions, though. I am building a React frontend, so persisting a reducer in localstorage and managing the session key in that reducer would be very easy. I would need to append this to requests, which seems to be the only downside. Wondering

Standard for storing session key

只愿长相守 提交于 2020-06-29 03:51:33
问题 After doing a bit of research on this topic, it seems like session keys have typically been stored as cookies which is nice because they get automatically added to requests. I've been seeing that developers prefer localstorage to cookies due to less restrictions, though. I am building a React frontend, so persisting a reducer in localstorage and managing the session key in that reducer would be very easy. I would need to append this to requests, which seems to be the only downside. Wondering

Same Flask login session across two applications

狂风中的少年 提交于 2020-06-28 04:11:20
问题 Two separate Flask applications, running on two different subdomains, however the login sessions are not persisting between the subdomains. For example; logging into a.example.co.uk will result in the user being logged in. However, visiting b.example.co.uk - the user will not be logged in. Running Apache, Flask (with Flask-Login), Ubuntu 18, Python 3. App secret is the same on both applications. Tried playing with SERVER_NAME configuration setting. Cookies are correctly being set to .example

creating cookies on file:/// url - evidence it is being created but not showing in document.cookie or cookie list in chrome dev tools

一世执手 提交于 2020-06-27 19:44:15
问题 I have some code that creates cookies. It creates two different user groups, checks for what group the users cookie is and does something based on it. The code is being developed on a local machine so it is accessed through a file:/// URL It looks like this: function cookieCreation() { var groupId = Math.floor(Math.random() * 2) + 1; var expDate = new Date(new Date().getTime()+60*60*1000*24).toGMTString() document.cookie = "userGroup_" + groupId + ";" + "expires=" + expDate +";path=/"; }