Click to See Complete Forum and Search --> : Session Problem


unknown_striker
10-13-2003, 10:45 AM
Hi all,

I am hosting one my server at home (Nusphere bundle - PHP, MySQL etc.), and I have dynamic DNS name to point to that server.

I also have a domain name, that forwards to that DNS address, but keeps the domain name in the address bar.

When I go to the domain name and use my login page (using sessions), it seems it logs in, but doesn't create / keep the session, and so when you browse to another page, it doesn't load properly because it cannot find the session variable, ie. UserID.

When I browse to the DNS name, bypassing the domain name, it works fine.

Any ideas?

Thanks,
C

pyro
10-13-2003, 12:11 PM
Look for this part in your php.ini file:

; The domain for which the cookie is valid.
session.cookie_domain =

and try setting it to your domain...

unknown_striker
10-21-2003, 08:25 AM
Hi,

Thanks for your reply.

I am still having this problem though. I have amended that line to read

session.cookie_domain = mydomain.com

mydomain.com replaced with my own domain.

Any other ideas?

Thanks,
C

Jona
10-21-2003, 01:28 PM
Try using a dot before it...


session.cookie_domain = .mydomain.com


If that doesn't work, try putting it in quotes (I doubt that would be necessary, though).

[J]ona

unknown_striker
11-05-2003, 05:47 AM
Hi,

Thanks again for the reply but this is still not working.

I have tried in quotes, out of quotes, with a . in front, without etc. But this is still not having it.

Any other ideas?

Cheers,
C

pyro
11-05-2003, 10:12 AM
Do you have a sessiondata directory inside your PHP directory?

unknown_striker
02-18-2004, 02:16 PM
Hi again,

I have since ditched the Nusphere bundle, and am now running IIS on WinXP and latest versions on PHP and MySQL.

I do have the sessiondata directory, and it has appropriate permissions set.

As I said before, if I access it using MyName.dyndns.org then sessions work fine, but if I access it using www.MyName.co.uk, (which just forwards to MyName.dyndns.org, keeping www.MyName.co.uk in the address bar), it doesn't work.

Any more ideas? I am sure others must have come accross this before.

Thanks,

C

unknown_striker
02-21-2004, 03:34 PM
Hi,

Apologies for bringing this back to the top, but has anyone got any thoughts on this?

Cheers,
C