cookies

Rename session cookies in Rails

眉间皱痕 提交于 2020-05-29 02:31:53
问题 since I'd like the session cookie to reflect the url and not the app name, I'd like to rename the cookies.. The current session cookie name is called _APPNAME_session is there a way to rename it to _somethingelse_session ? I see the name of it when I do curl -i <appurl> I see set_cookie = _APPNAME_session=.... 回答1: In config/initializers/session_store.rb, set/change the following line: For Rails < 5.0.0: <APPNAME>::Application.config.session_store :cookie_store, key: '_somethingelse_session'

Rename session cookies in Rails

余生长醉 提交于 2020-05-29 02:30:47
问题 since I'd like the session cookie to reflect the url and not the app name, I'd like to rename the cookies.. The current session cookie name is called _APPNAME_session is there a way to rename it to _somethingelse_session ? I see the name of it when I do curl -i <appurl> I see set_cookie = _APPNAME_session=.... 回答1: In config/initializers/session_store.rb, set/change the following line: For Rails < 5.0.0: <APPNAME>::Application.config.session_store :cookie_store, key: '_somethingelse_session'

Rename session cookies in Rails

自闭症网瘾萝莉.ら 提交于 2020-05-29 02:30:17
问题 since I'd like the session cookie to reflect the url and not the app name, I'd like to rename the cookies.. The current session cookie name is called _APPNAME_session is there a way to rename it to _somethingelse_session ? I see the name of it when I do curl -i <appurl> I see set_cookie = _APPNAME_session=.... 回答1: In config/initializers/session_store.rb, set/change the following line: For Rails < 5.0.0: <APPNAME>::Application.config.session_store :cookie_store, key: '_somethingelse_session'

Sharing cookies across .test sub-domains in Safari 13 not possible

懵懂的女人 提交于 2020-05-28 12:00:49
问题 I have a self-certificate for apache for https://example.test & https://m.example.test When browsing https://m.example.test cookies are set to the base domain '.example.test' using php 'session.cookie_domain'. This DOES work in Chrome, Firefox or Safari up-to-version-12. However, it does not work anymore in Safari 13 (iOS 13 or Catalina). What's even more strange is that the cookie is still set to the base domain on Safari 13 with my production machine for https://example.COM & https://m

Sharing cookies across .test sub-domains in Safari 13 not possible

扶醉桌前 提交于 2020-05-28 11:59:50
问题 I have a self-certificate for apache for https://example.test & https://m.example.test When browsing https://m.example.test cookies are set to the base domain '.example.test' using php 'session.cookie_domain'. This DOES work in Chrome, Firefox or Safari up-to-version-12. However, it does not work anymore in Safari 13 (iOS 13 or Catalina). What's even more strange is that the cookie is still set to the base domain on Safari 13 with my production machine for https://example.COM & https://m

how to delete cookie on logout in express + passport js?

这一生的挚爱 提交于 2020-05-28 05:00:14
问题 I want to "delete cookies on logout". I am not able to do that. I googled for answer and found following ways: Assign new date of expiration to cookie res.cookie('connect.sid', '', {expires: new Date(1), path: '/' }); Delete cookie using below lines res.clearCookie('connect.sid', { path: '/' }); I tried both ways individually but they do not delete the cookie. Here is my code: routes.js module.exports = function(app, passport, session){ app.get('/', function(req, res) { res.render('index.ejs'

How to tell PHP to use SameSite=None for cross-site cookies?

Deadly 提交于 2020-05-26 12:20:31
问题 According to the article here https://php.watch/articles/PHP-Samesite-cookies and PHP documenation at https://www.php.net/manual/en/session.security.ini.php, There are only 2 possible config options for this new feature, added in PHP 7.3: session.cookie_samesite=Lax session.cookie_samesite=Strict Yet, according to the Chrome console, this needs to be set to "None": A cookie associated with a cross-site resource at URL was set without the SameSite attribute. It has been blocked, as Chrome now

Display cookies in request headers in Safari 7

谁说胖子不能爱 提交于 2020-05-26 11:45:25
问题 When examining request headers in Chrome or Opera using their default console, I can see in the request headers what cookies have been sent to the server and if server is trying to set a cookie, I can also see Set-Cookie header. However, in Safari 7.1.2 I don't see these information, but I see other information such as Accept,, User-Agent, Referer etc. Do I need to enable something to see the cookies in the Safari's console? How can I view cookies that are being sent together with the request

Laravel 5.4 - Cookie Queue

爷,独闯天下 提交于 2020-05-26 04:32:37
问题 I'm using Laravel 5.4 and I wrote something like: Cookie::queue( 'refresh_token', $data->refresh_token, 864000, // 10 days null, null, false, true // HttpOnly ); return response('hello world'); The returned response doesn't contain the refresh_token cookie while return response('hello world')->withCookie(...) does. The Laravel 5.4 documentation doesn't anymore state queueing cookie as 5.0 doc does. Does it mean that the functionality has been removed in version 5.4 or did I make a mistake in

A cookie header was received that contained an invalid cookie.

浪子不回头ぞ 提交于 2020-05-24 21:20:49
问题 I am migrating my Server from Tomcat-6 to Tomcat-9 . My website is designed for the protocol of HTTP/1.1 . The server.xml file contains the Connector Protocol of org.apache.coyote.http11.Http11NioProtocol . The server starts up normally without generating any errors. However, when I try to access my website using localhost, I get the following error :- INFO [https-nio-8445-exec-3] org.apache.tomcat.util.http.parser.Cookie.logInvalidHeader A cookie header was received [ 2, 3, 4, 5, 6, 7, 8, 9,