session-cookies

(dis)advantages of sessions vs cookies

梦想的初衷 提交于 2019-12-04 10:55:09
I need some details about sessions. What are the disadvantages of session variables? Between cookies and sessions, which one is better? I'm not going to touch on security here as Infotekka already went into it quite a bit. It seems like you are asking whether you should use a SESSION or COOKIE as if they are alternatives to one another. They are not. They server (this was a typo..but I'm leaving it cuz it's a nice pun) different purposes. As HTTP is stateless, PHP (and others) offer the ability to simulate a state machine in your application through the use of a Session. If you did not do this

What happens to cookies of webview on closing the application?

会有一股神秘感。 提交于 2019-12-04 09:12:15
i am using a webview in an app which has keep me signed in functionality like facebook app.so in order to implement i need that the cookie should be persistant.I just wanted to know whether ios persists the cookie by default when the app is closed or i need to save the cookie manually before closing the app to implement keep me signed in functionality. any help would be deeply appreciated. Thanks Jake Vizzoni You want to use a NSHTTPCookieStorage object to manage the cookies. The short answer to your question is to use NSHTPPCookieStorage which will distribute the shared instance. You can use

Connecting to a PHP website with Node.js and keep session

大憨熊 提交于 2019-12-04 08:45:06
问题 I'm making a testbench with Test'em and Mocha (that run on node.js) in order to test a PHP website. What I want is to request some URL (e.g http://www.my-website/test.php) and get the http status code as well as the content returned. I'm doing it with the node.js Request module. The problem is: I need to be authenticated to access this page, otherwise I'm redirected to the login page. So, does it exist a way to log in my application through Node.js and keep the session open to be able to

Changing Cookie Domains

笑着哭i 提交于 2019-12-04 07:41:45
I use apache as a proxy to my application web server and would like to on the fly, change the domain name associated with a sessionid cookie. The cookie has a .company.com domain associated with it, and I would like using apache mod rewrite (or some similar module), transparently change the domain to app.company.com. Is this possible ? and if so, how would one go about it ? You can only change the domain of a cookie on the client, or when it's being set on the server . Once a cookie has been set, the path and domain information for it only exists on the client. So existing cookies can't have

Angular 5 - Cookie is set although (Set-Cookie) is in the response header

左心房为你撑大大i 提交于 2019-12-04 06:25:36
For an Angular 5 app, I have an auth service that does a HTTP POST which returns the session cookie (CORS) as shown below in the code below: signIn(signInRequest: SignInRequest): Observable<SignInResponse> { let headers: Headers = new Headers(); headers.append('Content-Type','application/json'); return this.http .post("/login", {email: signInRequest._email,password:signInRequest._password}, { headers: headers, withCredentials: true }) .map(this.extractData) .catch(this.handleErrorObservable);} The response of the header contains the set-cookie as shown below: and the request header is the

cURL cookie value [closed]

夙愿已清 提交于 2019-12-04 05:59:00
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center . Closed 7 years ago . I'm trying to download music loop files from this site: looperman.com. I've registered as a user, and I'm trying to download the loops using cURL. When you log into looperman.com, there are a few cookies set, but by process of elimination, I notice the

What is the difference between a Cookie and Redis Session store?

喜欢而已 提交于 2019-12-04 05:54:08
I want to share sessions among 2 applications on different nodes; however, I am confused what the difference is between Cookie and Redis session stores; e.g. a cookie session might look like this: rack.session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiJFN2YxZDMxMGE5YTNhZjc2NGM1NDBk%0AMzdiODQ0MjcyMzk5MzAxY2YyYzdhNDMwOWVkMzhiNWVlMmY2N2QwYzExNg%3D%3D%0A--ec4ec7b5a807c806e02e2811f4a11d05877a7698 In Redis, a session-store, might look like this: rack:session:eb23c0a055e9e6de3b8ad51efd9g6260d647b2e61326e35f5ff59cd490bfb405" However, I am confused how these sessions can be shared. Whereas in a cookie approach, a

Django session expires at browser close OR after time

为君一笑 提交于 2019-12-04 05:15:12
The Django documentation states: You can control whether the session framework uses browser-length sessions vs. persistent sessions with the SESSION_EXPIRE_AT_BROWSER_CLOSE setting. If SESSION_EXPIRE_AT_BROWSER_CLOSE is set to True, Django will use browser-length cookies -- cookies that expire as soon as the user closes his or her browser. Use this if you want people to have to log in every time they open a browser. This setting is a global default and can be overwritten at a per-session level by explicitly calling the set_expiry() method of request.session as described above in using sessions

My cookies are only available on PHP pages they are set on, is this normal?

不羁的心 提交于 2019-12-04 05:10:15
I cannot access cookies from any page other than the page they are set on. I looked at print_r($_COOKIE) on different pages and the only common variable between pages is the $_COOKIE['PHPSESSID'] . I am developing on a local XAMPP testing server. Is there a setting I should change on the PHP.ini or is this normal behavior for cookies? Sorry, I'm a little new to this stuff and I was under the impression cookies were accessible site wide. I am setting cookies like: setcookie("user", "Dave Schmave", time()+60*60*24*120); Any help would be greatly appreciated. Thanks Try setting the cookie path to

Cannot change php session cookie name

吃可爱长大的小学妹 提交于 2019-12-04 04:38:04
I copied an existing and successfully running site to a new development server. The login on the new server is now broken, and I tracked it down to the fact that although the session cookie is renamed ... ini_set('session.name', 'DOMAIN1'); ... the browser keeps storing the sesssion cookie as PHPSESSID. When I remove the above line from the application on the new server, the login works again. But this is not a good solution, because another application also uses PHPSESSID under this name. And I would prefer to find the reason for the strange behaviour instead of using a workaround. If I don't