Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safari can not request cors. #52

Closed
breaklee opened this issue Jun 7, 2015 · 4 comments
Closed

safari can not request cors. #52

breaklee opened this issue Jun 7, 2015 · 4 comments

Comments

@breaklee
Copy link

breaklee commented Jun 7, 2015

blow is my cors option.


cors : function() {
return {
origin : function(origin, callback) {
callback(null, origin === undefined || config.isWhiteList(origin)/always true/);
},
credentials : true,
methods : ["GET", "POST", "DELETE", "PUT", "UPDATE", "OPTIONS", "HEAD"],
exposedHeaders : ['Origin', 'Upgrade', 'Content-Encoding', 'Content-Range', 'Accept-Ranges', 'Range', 'Content-Type', 'Authorization',
'X-Forwarded-For', 'Connection', 'Host', 'Content-Length', 'X-Real-IP', 'X-Requested-With', 'Set-Cookie', 'Cookie'],
allowedHeaders : ['Origin', 'Upgrade', 'Content-Encoding', 'Content-Range', 'Accept-Ranges', 'Range', 'Content-Type', 'Authorization',
'X-Forwarded-For', 'Connection', 'Host', 'Content-Length', 'X-Real-IP', 'X-Requested-With', 'Set-Cookie', 'Cookie']
}
}


and this is used as middleware


app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended : false }));
app.use(cookieParser());
app.use(cors(config.cors()));

app.use(sessionStore(app, config));

it works fine chrome env. but not working in safari.
( always refresh cookie values in safari )

how can i handle this?

@troygoode
Copy link
Member

@breaklee what error are you seeing in Safari?

@breaklee
Copy link
Author

@troygoode there are no errors. every request has different session id.
im using session store "express-session", "redis"

@gabeio
Copy link
Member

gabeio commented Jun 16, 2015

@breaklee are you requesting a session across domains? ie: on, google.com requesting login & a page from youtube.com (subdomains may also have issues depending on cookie settings)? I think this might be more over an express-session issue.

@troygoode
Copy link
Member

@breaklee is this happening on localhost, or in production? if in production, are you serving it over HTTPS? (wondering if this is related to #45)

@troygoode troygoode reopened this Jun 19, 2015
dougwilson pushed a commit that referenced this issue Jul 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants