cookies

Cookie not being set on angular client

我的梦境 提交于 2020-08-04 06:33:08
问题 I have a backend app in django python and it is being served on http://localhost:8000. I have a angular frontend which is being served on http://localhost:4200. I have disabled CORS on django. On hitting the login api on http://localhost:8000/auth/login/, I am getting a valid response along with the Set-Cookie header. Here is my angular code to print the cookies: this.http.post<any>('http://localhost:8000/auth/login/', this.LoginForm, { observe: 'response' }).subscribe(response => { console

Set-Cookie header not setting cookie in Chrome

核能气质少年 提交于 2020-08-03 14:49:32
问题 I'm AJAXing a call to a another services API, which is then supposed to return a cookie that will be set in my browser to allow me to make the rest of my API calls. However, while the response headers include a 'Set-Cookie' header, no cookie is ever actually set. I'm using Google Chrome. Here is the Response Headers: Access-Control-Allow-Origin:* Cache-Control:no-cache Connection:keep-alive Content-Encoding:gzip Content-Length:37 Content-Type:application/json Date:Thu, 25 Jun 2015 18:27:37

How do I pass cookies on a CURL redirect?

邮差的信 提交于 2020-08-02 06:07:52
问题 imagine the following scenario: I open a CURL connection and pass some XML-Logindata via POST. The server answers with an 302 redirect, where the session cookies are set and redirects me to a following "welcome"-page. If I enable FOLLOWLOCATION the cookies set on the redirection-page get lost and the welcome-page fails with a "session expired"-message. If I disable FOLLOWLOCATION, I'm not redirected (obviously) and get a HTML-page with "the page has moved to another location" with a link that

How do I pass cookies on a CURL redirect?

自闭症网瘾萝莉.ら 提交于 2020-08-02 06:06:29
问题 imagine the following scenario: I open a CURL connection and pass some XML-Logindata via POST. The server answers with an 302 redirect, where the session cookies are set and redirects me to a following "welcome"-page. If I enable FOLLOWLOCATION the cookies set on the redirection-page get lost and the welcome-page fails with a "session expired"-message. If I disable FOLLOWLOCATION, I'm not redirected (obviously) and get a HTML-page with "the page has moved to another location" with a link that

How to put Cookie session id into volley request?

自作多情 提交于 2020-07-30 04:30:08
问题 So, i have this code to make a POST request with volley: public class MainActivity extends AppCompatActivity { Button btnSearch; ProgressDialog loadingDialog; ListView lvResult; String session_id; RequestQueue queue; MyCookieManager myCookieManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btnSearch = (Button) findViewById(R.id.btnSearch); lvResult = (ListView) findViewById(R.id.lvResult);

How to put Cookie session id into volley request?

主宰稳场 提交于 2020-07-30 04:30:06
问题 So, i have this code to make a POST request with volley: public class MainActivity extends AppCompatActivity { Button btnSearch; ProgressDialog loadingDialog; ListView lvResult; String session_id; RequestQueue queue; MyCookieManager myCookieManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btnSearch = (Button) findViewById(R.id.btnSearch); lvResult = (ListView) findViewById(R.id.lvResult);

How to put Cookie session id into volley request?

五迷三道 提交于 2020-07-30 04:30:02
问题 So, i have this code to make a POST request with volley: public class MainActivity extends AppCompatActivity { Button btnSearch; ProgressDialog loadingDialog; ListView lvResult; String session_id; RequestQueue queue; MyCookieManager myCookieManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btnSearch = (Button) findViewById(R.id.btnSearch); lvResult = (ListView) findViewById(R.id.lvResult);

How to read cookies?

我们两清 提交于 2020-07-30 03:26:59
问题 I set a cookie from javascript such as: setCookie("appointment", JSON.stringify({ appointmentDate: selectedDay.date, appointmentStartMn: appointment.mnRange[0], appointmentId: appointment.id || 0, appointmentUserId: appointment.user.id || 0 }) ); After cookie is set I want to redirect the user to a booking page: window.location.href = "https://localhost:8080/booking/" The setCookie function: function setCookie(cookieName, cookieValue) { document.cookie = `${cookieName}=${cookieValue};secure;`

How to enable samesite for jsessionid cookie

无人久伴 提交于 2020-07-29 05:27:51
问题 How can i enable samesite for my web application which runs on wildfly as. Checked standalone.xml however could not find an appropriate tag within <servlet-container name="default"> <session-cookie http-only="true" secure="true"/> <jsp-config/> </servlet-container> 回答1: As for now the Java Servlet 4.0 specification doesn't support the SameSite cookie attribute. You can see available attributes by opening javax.servlet.http.Cookie java class. However, there are a couple of workarounds. You can

Chrome localhost cookies not being set

半世苍凉 提交于 2020-07-22 10:12:44
问题 I'm setting up ASP.NET Core authentication in different configurations, using Google Chrome as a development and test tool. Everything worked fine locally, but suddenly it stopped. I've inspected the http headers and I found Set-Cookie one there in my POST response, but nothing in the next request nor in the Application->Storage->Cookies tab. I've inspected the console and found no errors nor warnings there. I've restated and updated Chrome (with no effect) and finally switched to Edge and