Forum Moderators: coopster

Message Too Old, No Replies

Cookies, Sessions, localhost

some issues..

         

ag_47

10:58 pm on Jul 10, 2008 (gmt 0)

10+ Year Member



I just came across a problem while working on a project. I have a local Apache server set up for this purpose. Now, a while ago I had problems setting cookies through setcookie(.. ). This was easy to fix, just use false as domain parameter.

Now I started on a section where I use Sessions. The problem is, the session cookie is not created!
I set all options as needed in php.ini (domain=false ..), and even tried:


session_set_cookie_params(0, '/', false, 0, 1);
print_r( session_get_cookie_params() );

Which produces:

Array ( [lifetime] => 0 [path] => / [domain] => [secure] => [httponly] => 1 )

If I change domain to '', instead of false, Firefox accepts the cookie but not IE.
It's not that big if deal, I use Firefox for testing anyway, I'm sure this will work fine once the site is uploaded onto a real server. But still, any suggestions?

eelixduppy

11:46 pm on Jul 10, 2008 (gmt 0)



Try using default values and see what you get:
[php.net...]

ag_47

1:49 am on Jul 11, 2008 (gmt 0)

10+ Year Member



errm, after trying to make a couple of changes in php.ini/set_params to get this to work, well, now even Firefox won't accept cookies.. Everything is as it should be:

session.use_cookies = 1
;session.cookie_secure =
session.use_only_cookies = 1
session.name = PHPSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain = ""
;session.cookie_httponly = 1
session.serialize_handler = php

Getting a little frustrated.. I just need to test sessions locally...

ag_47

4:43 am on Jul 11, 2008 (gmt 0)

10+ Year Member



it just stopped working.. Sorry for double posting, but after 3 hours still nothing.
The SID cookie worked perfectly in Firefox this afternoon, but now, nothing! I tried defaults, all kinds of suggestions from other sites, session_set_cookie_params()..

Anyone?..