session-cookies

Postman: How do you delete cookies in the pre-request script?

只愿长相守 提交于 2020-02-20 06:27:46
问题 All the postman cookie-management answers I've seen refer to either the browser extension (open chrome, delete cookies viz interceptor etc) or with the app, using the UI to manually manage cookies. I would like to delete certain cookies in my pre-request code as part of scripting my API tests. (delete them programmatically) The Sandobx API docs mention pm.cookies so I tried if (pm.cookies !== null) { console.log("cookies!"); console.log(pm.cookies); } But the pm.cookies array is empty. Yet in

How to prevent CakePHP 3.0 from extending session timeout with ajax requests?

僤鯓⒐⒋嵵緔 提交于 2020-02-08 02:28:09
问题 How can I prevent CakePHP 3.x from extending my users session when background ajax calls are made to the server? I am using jquery's $.ajax() as well. I have a setInterval running once a minute to get some user notifications. My application is an EHR and I need to maintain strict session timeout. My get notifications Javascript basically just made my sessions unlimited because the ajax calls are extending the sessions. I thought a saw something in the CakePHP book about this a few weeks ago

Capture and Reuse Cookies with Requests

跟風遠走 提交于 2020-01-24 20:57:07
问题 I've seen posts on how to use the Requests library in Python to send a cookie, but haven't been able to find anything on sending multiple. I'm trying to capture the entire RequestsCookieJar and use it as the cookies for future Posts. Here is what I'm currently working with: >>> import requests >>> s = requests.Session() >>> content = s.get('https://admin.url.com/login.html', verify=False) >>> print s.cookies <<class 'requests.cookies.RequestsCookieJar'>[<Cookie _hauavc_4699a329=b27e38d for

expire session when there is no activity in PHP

本小妞迷上赌 提交于 2020-01-24 07:42:21
问题 I found many tutorials on Internet when you expire a session after a certain limit, like after 30 minutes or so, But I want to expire a session when there is no activity, quoting from a famous SO question the solution is straight forward: if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 1800)) { // last request was more than 30 minutes ago session_unset(); // unset $_SESSION variable for the run-time session_destroy(); // destroy session data in storage } $

How to prevent multiple logins from same user?

我是研究僧i 提交于 2020-01-24 00:57:31
问题 How can I prevent a logged-In member from logging into their account (in a new tab or different device) without logging out of their existing session ? I am working on a client job-board website where logged-in employers can submit a single Job Vacancy via the post_job.php page. The problem is they can Login again from a new tab or device without logging out and post more than their permitted single job posting. What would be the easiest way of preventing employers from doing this ? I am a

Android Login with Token Session: like user logins and stays in session until logout

随声附和 提交于 2020-01-22 10:04:47
问题 After login in android app, how do I create a token session in the php api? Like this: I would like to make sure that when user log in it will stay in session no matter what happens (crashed, shut down/power down/reboot, leaving the app) at same time the user info data will be sending with all the activities in the app to the webserver. Do I simply use: session_start(); $_SESSION['username'] = $user; $_SESSION['auth'] = "true"; If so how do I pass this session into the android application?

Rails - Store a cookie in controller and get from Javascript, Jquery

 ̄綄美尐妖づ 提交于 2020-01-22 09:58:30
问题 Is it possible to store a User's Cookie or Session in Controller and Get the cookie by accessing it from JS or Jquery? 回答1: Session values are available on the server. You can set them like this in your controller: session[:user_name] = @user.name If you want to access that value later in javascript, you'll probably want to do something like this in a view: <%= javascript_tag do %> var userName = '<%= session[:user_name %>'; <% end %> Cookies are managed by the browser, so accessed

WebView not accepting some cookies

喜夏-厌秋 提交于 2020-01-21 09:27:04
问题 I'm loading a website in Webview which uses some cookies to store session. I've written following lines to accept cookies CookieSyncManager.createInstance(this); CookieSyncManager.getInstance().startSync(); CookieManager.getInstance().setAcceptCookie(true); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { CookieManager.setAcceptFileSchemeCookies(true); CookieManager.getInstance().setAcceptThirdPartyCookies(webView, true); } webView.loadUrl("https://www.irctc.co.in/nget/train

What is the difference between cookie and cookiejar?

折月煮酒 提交于 2020-01-20 02:18:04
问题 Today I faced with the term "cookiejar" (package net/http/cookiejar ). I tried to gather some information regarding it, but got nothing intelligible. I know that cookie is key/value pairs that server sends to a client, eg: Set-Cookie: foo=10 , browser store it locally and then each subsequent request browser will send these cookies back to the server, eg: Cookie: foo=10 . Ok, but what about cookiejar ? What is it and how it looks like? 回答1: As you described in your question, cookies are

localStorage vs sessionStorage vs cookies

纵然是瞬间 提交于 2020-01-19 02:33:28
问题 I am working in an app where I need to keep some data during the user is logged in and I have that question, what is the difference among localStorage, sessionStorage, cookies ??? I was asking what can I use in order to persist some data in the DOM, even if the user refresh the page, some people says: use sessionStorage, or localStorage, then, someone came up with the idea of use ngCookies because it works in every browser, but, which should I use ? 回答1: localStorage and sessionStorage are