Welcome Guest, Not a member yet? Register   Sign In
unable to create session cookie
#11

[eluser]WanWizard[/eluser]
Since the OP had a problem with native sessions, yours is a different issue.

We don't know what's wrong, we can't look into your environment and code? Have you debugged it? What did you test? What was the result?

For starters, disable the session cookie encryption in the config, so you can read the cookie. Is the cookie created in Safari? If so, what it it's contents, and does it match the session in the db? If not, is your session config ok (domain, path, cookie name)?
#12

[eluser]Bazze[/eluser]
[quote author="WanWizard" date="1291530046"]Since the OP had a problem with native sessions, yours is a different issue.

We don't know what's wrong, we can't look into your environment and code? Have you debugged it? What did you test? What was the result?

For starters, disable the session cookie encryption in the config, so you can read the cookie. Is the cookie created in Safari? If so, what it it's contents, and does it match the session in the db? If not, is your session config ok (domain, path, cookie name)?[/quote]
I added print 'ok'; die; just after where the set_userdata(); function is issued, and it is printed. So it gets to the code where the session is set, so that is obviously not the problem. And the code works perfect in Firefox and Chrome (haven't checked IE yet), but not in Safari.

Printing out the session_id gives different value on every page refresh in Safari. In Firefox and Chrome it is the same.

Currently running the server locally, but I'm accessing the site through my IP-adress. The IP-adress is also set as the cookie domain.

EDIT
Seems to be working fine in Safari when not running the site locally. Very strange.
#13

[eluser]WanWizard[/eluser]
Did you define the cookie_domain when running locally? To what?

Know that 'localhost' is NOT a valid cookie domain. Modern browsers will refuse to accept the session cookie. An IP address is fine.
#14

[eluser]Bazze[/eluser]
[quote author="WanWizard" date="1291588456"]Did you define the cookie_domain when running locally? To what?

Know that 'localhost' is NOT a valid cookie domain. Modern browsers will refuse to accept the session cookie. An IP address is fine.[/quote]
Okay, but I do use my IP-adress as cookie domain when running locally.
Code:
$config['cookie_domain']    = "XX.XXX.XXX.XXX";
Maybe Safari doesn't accept an IP-adress either?
#15

[eluser]Unknown[/eluser]
I don’t have a Mac handy, so no safari.

I’ve justed tested:
- FF 3.6.7 on Linux
- Chrome 6.0.472 on Linux
- FF 3.0 on Windows XP
- Opera 9.52 on Windows XP
- IE6 on Windows XP

They all work.

What exactly are your session and cookie configuration settings?
#16

[eluser]Bazze[/eluser]
[quote author="morphine" date="1291642488"]I don’t have a Mac handy, so no safari.

I’ve justed tested:
- FF 3.6.7 on Linux
- Chrome 6.0.472 on Linux
- FF 3.0 on Windows XP
- Opera 9.52 on Windows XP
- IE6 on Windows XP

They all work.

What exactly are your session and cookie configuration settings?[/quote]
Yeah, they do! Seems to be trouble only with Safari when running locally. These are my settings:
Code:
$config['sess_cookie_name']              = 'ci_session';
$config['sess_expiration']               = 7200;
$config['sess_encrypt_cookie']           = TRUE;
$config['sess_use_database']             = TRUE;
$config['sess_table_name']               = 'ci_sessions';
$config['sess_match_ip']                 = FALSE;
$config['sess_match_useragent']          = TRUE;
$config['sess_time_to_update']           = 300;
$config['cookie_prefix']                 = "";
$config['cookie_domain']                 = "XX.XXX.XXX.XXX";
$config['cookie_path']                   = "/";
#17

[eluser]WanWizard[/eluser]
The only thing I see here is the underscore in the cookie_name. Some browsers are allergic to it, I don't own a Mac, so I don't know if Safari has a problem with that as well.

Other than that, I suggest you start debugging.

As I said before, disable encryption (set sess_encrypt_cookie to FALSE), and use a tool (don't know what to use on a Mac) to monitor the HTTP headers of the request and response. And check if the browser receives the cookie. If so, what is the contents and the expiration? If not, what's in the HTTP headers?
#18

[eluser]Bazze[/eluser]
I found the answer: http://www.anyware.co.uk/2005/2010/11/11...p-address/




Theme © iAndrew 2016 - Forum software by © MyBB