session-cookies

Cookies not setting in Safari 6

和自甴很熟 提交于 2019-12-04 03:53:07
Good evening, I've asked this question a couple of times without responses, hope this time goes well. I've been developing facebook apps for a couple of years now, using php and the Facebook PHP SDK. Lately I've been struggling with Safari and the login with Facebook. The problem is that Safari 6 has checked by default the "Block 3rd party cookies" option, so my app can't set the cookies automatically. I'm seeing this only in Safari, the cookies are empty, unlike Chrome or Firefox, both are saving cookies well. I'm logging in the user with the Facebook PHP SDK example , so I don't know where

Keeping a session when using HttpWebRequest

本小妞迷上赌 提交于 2019-12-04 03:49:54
In my project I'm using C# app client and tomcat6 web application server. I wrote this snippet in the C# client: public bool isServerOnline() { Boolean ret = false; try { HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(VPMacro.MacroUploader.SERVER_URL); req.Method = "HEAD"; req.KeepAlive = false; HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); if (resp.StatusCode == HttpStatusCode.OK) { // HTTP = 200 - Internet connection available, server online ret = true; } resp.Close(); return ret; } catch (WebException we) { // Exception - connection not available Log.e(

Sails.js authorization for socket requests

若如初见. 提交于 2019-12-04 03:44:54
I'm trying to build a chat application based on sails.js. The url for messages from a specific chat looks like this: /api/chat/:id/messages When I request this url with XHR, it provides a session cookie and sails.js builds a session object. I can easily check user rights to read the messages from the specific chat. However, I need to request this url with socket.io so that the client can subscribe to all future changes of the messages collection. When I request this url with socket.io, no session cookie is set and the sails.js session is empty. So, I cannot check the user rights on the server

Rack Session Cookie and Sinatra - setting and accessing data

谁说我不能喝 提交于 2019-12-04 03:43:14
I was using Rack Session Pool, however my users would get kicked off one webserver thread onto another making the session data expire. I started toying around with just enable :sessions in Sinatra, however I am unable to use that because I have mutliple apps using Sinatra (same key it appears to be using - not sure if this is because its the same host or not) So since my apps would break each other, I now am trying Rack Session Cookie and setting the variables (same thing as enable :sessions, but you can set the variables) Great so that works! But now I cannot access the session data the way I

Destroy a PHP session on clicking a link

别等时光非礼了梦想. 提交于 2019-12-04 03:29:58
Is this code valid? <a href="#" onclick="<?php session_destroy();?>">Logout</a> No it is not a valid code. It will destroy the session at the time of loading the php page. For destroying session on click you should write <a href="logout.php" >Logout</a> in logout.php session_destroy(); Make a page called logout.php Logout.php_ _ ___ <?php Session_start(); Session_destroy(); header('Location: ' . $_SERVER['HTTP_REFERER']); ?> Your page_ _ ____ <a href="Logout.php">Logout</a> Wrong code. you can use this code: <?php if($_GET['logout']==1) session_destroy(); ?> <a href="?logout=1">Logout</a> That

Can't delete cookie with AngularJS's $cookies

眉间皱痕 提交于 2019-12-04 02:59:50
问题 My web app is made so that when a user logs in the server adds a Set-Cookie header to the response, like this: Set-Cookie:JSESSIONID=1; Path=/myApp/; Secure On logout I try to delete this cookie on the client (browser), as I don't care if the session was successfully destroyed on the server as long as the cookie is deleted. Any lingering "ghost" sessions will be cleaned up from time to time on the server. However, my app is unable to delete the JSESSIONID cookie. Say the logout function was

How to delete/unset a cookie on php?

旧城冷巷雨未停 提交于 2019-12-04 02:55:49
问题 I want to unset/delete my existing cookie with this: setcookie ("user", "", time()-1); unset($user); But cookies can not be deleted or unset. So what is problem? 回答1: you can unset cookies this way only may -1 not work try this setcookie ("user", "", time() - 3600); 回答2: When deleting a cookie you should assure that the expiration date is in the past. Delete example: // set the expiration date to one hour ago setcookie("user", "", time()-3600); 回答3: Nothing - that code looks fine to me.

What is the advantage of using Gorilla sessions custom backend?

不打扰是莪最后的温柔 提交于 2019-12-04 02:44:38
I want to use Redis for session management. But I can't figure out what the advantage is of using Redis as a custom back-end for Gorilla sessions package over using it directly? link to the Gorilla session package: http://www.gorillatoolkit.org/pkg/sessions Gorilla sessions provides a means to wire up a storage system for session management provided you adhere to the interface provided. Currently, they give you two stores out of the box. One is a FilesystemStore that adheres to the interface that simply stores and retrieves session based data on the server's filesystem. The CookieStore as

Multiple sessions in one instance using PHP?

前提是你 提交于 2019-12-04 01:52:44
问题 I have a project where I would like to create two session cookies in one browser. The first session would be to uniquely identify a person, the second would be to share events within the session between users. I have been using a database for this, but would like the data to disappear when the session dies. There are no logins within the system. Is there a way to do this, other than creating a cookie system to replicate functionality? For example, we would have two session cookies: name

Can't get Express session ID from cookies w/ Socket.IO

旧城冷巷雨未停 提交于 2019-12-03 23:53:32
I have a typical web application in Node that is utilizing the Express framework and the session middleware. I am also using Socket.io for certain dynamic parts of my application (currently, this is a chat mechanism, but that's tangential). I've been able to successfully set up sessions and socket.io on their own, but would like to combine them (EG: to associate socket chat messages with user accounts without hitting the database). It should be noted (and I can see this being a possible issue point), I am running two express servers on different ports: one for regular HTTP traffic, and one for