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

setting cookies on local network is weird in some browsers #31

Closed
ikkez opened this issue May 21, 2012 · 1 comment
Closed

setting cookies on local network is weird in some browsers #31

ikkez opened this issue May 21, 2012 · 1 comment

Comments

@ikkez
Copy link
Collaborator

ikkez commented May 21, 2012

setting Sessions and Cookies are using the JAR F3 var.

$jar=array(
    'expire'=>0,
    'path'=>$base?:'/',
    'domain'=>'.'.$_SERVER['SERVER_NAME'],
    'secure'=>($scheme=='https'),
    'httponly'=>TRUE
);

if $_SERVER['SERVER_NAME'] returns an IP address, the response header contains Set-Cookie: domain=.192.168.0.5
and because of the leading dot =. the cookies is rejected by some browser.

i recommend to include a condition that check's that and only adds the . if it's really a host name, and not an address.

@stevewasiura
Copy link
Contributor

another dejavu. i mentioned this back on the old forum. http://sourceforge.net/projects/fatfree/forums/forum/1041717/topic/5047622

i recommend getting rid of the leading dot and setup your domain's dns to redirect any requests for domain.com to www.domain.com, thereby insuring the cookie is set for the proper domain. i believe that redirect also helps with search engines indexing your website correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants