cookies

Can I run Selenium ChromeDriver with cookies from actual Chrome installation?

为君一笑 提交于 2019-12-29 06:50:10
问题 So I'm running a selenium test using IntelliJ IDEA + chromedriver on an Ubuntu machine... In my Google Chrome installation, I have logged in to an account, say Google. When I access http://accounts.google.com in the selenium test, I get to the log in page instead of the actual account management page. I'm pretty sure that I don't fully understand the exact way that Selenium and the chrome driver operate, but I do remember that having 'Google Chrome installed in the default location' is one of

PHP session or cookie

坚强是说给别人听的谎言 提交于 2019-12-29 05:56:13
问题 What's best way to keep user logged on a PHP-powered site until he closes his browser? The first and the most popular way is to go with $_SESSION . The second is to pass zero as the third argument of setcookie function: setcookie(name, value, 0, domain); 回答1: As PHP session actually stores the SID by cookie (of course you can use other ways to set the SID if you like), there would not be much difference when simply using them. The main difference is security, because if you use cookies

ng2 get csrf token from cookie post it as header

无人久伴 提交于 2019-12-29 05:36:12
问题 After spending 2 full days searching the web and reading docs and tons of open questions of people facing the same problem, i still don't grasp how Angular 2 handles the (x-origin) cookies and how to access them. The problem: Back-end sends 2 cookies with x-csrf-token & JSESSIONID inside of it. My job is to keep the csrf token in memory (ng2) and send it (only) back as header (not cookie) with every post to the back-end. HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Access-Control-Allow-Origin:

NSHTTPCookies refuse to be deleted

痞子三分冷 提交于 2019-12-29 05:27:07
问题 I need a log out button for my app, I have the below code: while ([[[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies] count] != 0) { for (NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) { [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie]; } } (the while is just there to make sure they get deleted, it only runs once however) If I NSLog the description of shared cookie storage after the above code it outputs that the array is empty.

Difference between 0 and negative value for setMaxAge for Cookie

喜你入骨 提交于 2019-12-29 05:19:06
问题 From cookie docs for setMaxAge(int): http://docs.oracle.com/javaee/1.3/api/javax/servlet/http/Cookie.html#setMaxAge(int) Is there any difference between int = 0 and int = -ve ? It says 0 deletes cookie. -ve value means cookie is not stored. Does that mean 0 deletes only from current browser session? 回答1: I suggest you go read about cookies from a browser perspective. It's very interesting. Note that 'max-age' is the newer version of 'expires' and some browsers may not support it. (For example

Why cookies dont expire after closing browser?

瘦欲@ 提交于 2019-12-29 04:20:08
问题 In books and tutorials related with Web-programming written that cookies expire when user close browser. So I cant understand why after closing browser(Opera) I can see the list of my cookies in "Parameters" window. And how sites (for example Facebook) identifier users after closing browser (session cookies must expire according to books and tutorials)? 回答1: Cookies are of two different types: session cookies, held in memory, and which expire once the browser exits persistent cookies, which

PHP Login system using Cookies and Salted Hashes

。_饼干妹妹 提交于 2019-12-29 03:31:23
问题 I am developing a PHP-based login system. Each user has an ID(a number) and a password, which is stored as a salted hash. I am able to figure out if a login is sucessful or not, but now I need to store that information somewhere(so that the user is not permanently logged out). In the past, I've played with $_SESSION variables. However, these seem to be deleted when the user leaves the browser, which is undesired. Also, I can not "assume" that the user won't try to trick the system, so it has

Sharing session across rails apps on different subdomains

笑着哭i 提交于 2019-12-29 03:30:28
问题 I am trying to implement a single-sign-on solution for multiple rails (v3.2) apps hosted at different subdomains of example.com One app serves as an identity provider, uses devise for auth, and sits at users.example.com The other apps rely on the identity provider for authentication, use devise+omniauth, with domains of [app1.example.com, app2.example.com, and example.com]. This blog entry inspired much of my implementation: http://blog.joshsoftware.com/2010/12/16/multiple-applications-with

How to set asp.net Identity cookies expires time

笑着哭i 提交于 2019-12-29 03:04:54
问题 I use Asp.Net Identity to control my app's authorization. Now, I need to do this: if the user does not operate in 30 minutes, jump to the login page, when he login does not select "isPersistent" checkbox. And, if he selected "isPersistent" checkbox, set the expiration date of cookie for 14 days. I try to do this by change the Startup.Auth.cs like this: public void ConfigureAuth(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType =

ASP.Net FormsAuthentication Redirect Loses the cookie between Redirect and Application_AuthenticateRequest

微笑、不失礼 提交于 2019-12-29 01:47:26
问题 I have a FormsAuthentication cookie that is persistent and works independently in a development, test, and production environment. I have a user that can authenticate, the user object is created, the authentication cookie is added to the response: 'Custom object to grab the TLD from the url authCookie.Domain = myTicketModule.GetTopLevelDomain(Request.ServerVariables("HTTP_HOST")) FormsAuthentication.SetAuthCookie(authTicket.Name, False) Response.SetCookie(authCookie) The user gets processed a