cookies

Yii2 Never Logout Idle Or Away User

半世苍凉 提交于 2021-01-29 07:18:05
问题 User's in Yii appear to be logged out automatically if they close their browser or are idle for about a day (maybe less, I'm not sure). Is it possible to not log them out ever (or at least for a long time for month or year). Not sure if the Session parameters or Cookie parameters need to change. I've tried changing the parameters. 'components' => [ 'session'=>[ 'class' => 'yii\web\Session', 'cookieParams' => ['httponly' => true, 'lifetime' => 3600 * 4* 365], 'timeout' => 3600*4 *365,

How can I delete the _myapp_session cookie in Google Chrome Storage using a controller in Rails 6?

会有一股神秘感。 提交于 2021-01-29 06:19:19
问题 I'm using Rails 6, Devise for authentication and testing my app on Google Chrome. I can log in successfully. However when the user tries to log out by clicking on the Log Out button, it doesn't log out and only redirects to the home page. I have the application containerised using Docker and Docker Compose and I'm using PostgreSQL for the database, ElasticSearch for search and NGINX for the web server. This appears to be a caching or cookie issue. When I delete the _myapp_session cookie in

Why can Cookies be set by PHP nut not Local Storage

£可爱£侵袭症+ 提交于 2021-01-29 06:09:21
问题 Lets rewind to the days of cookies , ok not that far as they are old but still relevant. You can set them and read them with PHP; despite the fact they are a client side technology, you can also use JavaScript, fully client side. Coming forward in to the future, HTML5 Local Storage , also a Client Side technology can not be set by PHP, you are solely reliant on JavaScript. It seams as though this is the reverse way of doing it (taking away not adding). Surely to have the ability to set this

mod_rewrite based on cookie value

て烟熏妆下的殇ゞ 提交于 2021-01-29 03:51:26
问题 I have a multilingual website and I need change the URL based on a cookie value. For example, I have $_COOKIE["lang"] = "en" and I want to change the URL to either www.mydomain.com/en/rest/of/the/url or en.mydomain.com/rest/of/the/url . How can I do this? 回答1: Use any kind of redirect available to you. In vanilla php you can user header(). mod_rewrite is a webserver-based directive, it works well before your php script gets a chance to kick in, and it most definitely cannot touch cookies.

mod_rewrite based on cookie value

僤鯓⒐⒋嵵緔 提交于 2021-01-29 03:35:46
问题 I have a multilingual website and I need change the URL based on a cookie value. For example, I have $_COOKIE["lang"] = "en" and I want to change the URL to either www.mydomain.com/en/rest/of/the/url or en.mydomain.com/rest/of/the/url . How can I do this? 回答1: Use any kind of redirect available to you. In vanilla php you can user header(). mod_rewrite is a webserver-based directive, it works well before your php script gets a chance to kick in, and it most definitely cannot touch cookies.

Python Selenium: How to get cookies and format them to use in an http request

久未见 提交于 2021-01-29 02:50:49
问题 I am wondering the best way to get the cookies from a selenium webdriver instance (chromedriver), and convert them into a cookie string that can be passed as an http header. Here is the way I have tried doing it: getting the list of a dictionary per cookie that selenium provides, then manually adding equal signs and semicolons to format it as it would be in the Cookie header. The problem is: this does not work, on the site I'm testing it returns 500 internal server error, which I assume is

How to extract browser cookie(s) using Katalon Studio

点点圈 提交于 2021-01-29 00:55:46
问题 I am trying to get all the cookies of the browser which is opened while we execute automation test using Katalon. Please suggest how we can extract a specific cookie/list of cookies using Katalon. I have checked in traditional Selenium/Java; its pretty easy - driver.manage().getCookieNamed("Cookie Name").getValue(); But I am not getting any clue how to do this in Katalon. 回答1: Resolved it.... import com.kms.katalon.core.webui.driver.DriverFactory import org.openqa.selenium.WebDriver WebDriver

How to extract browser cookie(s) using Katalon Studio

為{幸葍}努か 提交于 2021-01-29 00:48:12
问题 I am trying to get all the cookies of the browser which is opened while we execute automation test using Katalon. Please suggest how we can extract a specific cookie/list of cookies using Katalon. I have checked in traditional Selenium/Java; its pretty easy - driver.manage().getCookieNamed("Cookie Name").getValue(); But I am not getting any clue how to do this in Katalon. 回答1: Resolved it.... import com.kms.katalon.core.webui.driver.DriverFactory import org.openqa.selenium.WebDriver WebDriver

Get a cookie in Laravel 5 middleware

不羁的心 提交于 2021-01-28 19:26:03
问题 I'm trying to retrieve a cookie from a middleware in Laravel 5.3 but it seems like $request->cookie('language') is empty. I'm guessing that it is only set after the middleware runs. I read somewhere that I should use \Cookie::queued('language'), but it's still empty. Is my only option using the $_COOKIE variable? 回答1: When do you set this cookie? Remember that cookies are stored in the browser, so the user needs to get the response in order for you to be able to retrieve the cookie later. You

How come requests from a “www” subdomain to a different subdomain considered “same-site”?

左心房为你撑大大i 提交于 2021-01-28 18:13:35
问题 Why does www.web.dev and static.web.dev count as the same site, while your-project.github.io and my-project.github.io count as different sites? There's a part from this page (https://web.dev/samesite-cookies-explained/) that is confusing me: Key Term: If the user is on www.web.dev and requests an image from static.web.dev then that is a same-site request. The public suffix list defines this, so it's not just top-level domains like .com but also includes services like github.io. That enables