Session is not maintained when page gets redirected to another in my localhost, I have a admin login page of my osCommerce v2.0 site, whenever i login its the session registered in login page is not found in index page hence redirected back to login page... Please guide me why this happening in my localhost and not in my server?
+2
A:
There is a php.ini setting called session.auto_start, more than likely that is set on your main server.
cmendoza
2010-06-21 12:52:39
+1 Sometimes I feel that GOD forgot to script the conflict script script for my silly brain :) thanxxxx cmendoza
OM The Eternity
2010-06-21 12:58:48
+1
A:
The issue may be with the cookies not being sent back by the browser, "localhost" has caused me problems with this in the past. This is something to do with the fact that you don't have a period in the domain name which is required by the spec IIRC (you obviously do in the real server which is why it works there).
Open c:\windows\system32\drivers\etc\hosts
and add an alias:
127.0.0.1 server.local
Alter your osCommerce config as necessary and try accessing the page again via server.local and see what happens.
Paolo
2010-06-21 12:56:00
+1 Grt!!! I learnt something new on my silly question :) thanks Paolo
OM The Eternity
2010-06-21 13:00:02
I cannot select two answers as accepted but your reply also helped me to resolve my problem thanks again, But here i would like to know why is the case it needs the period in domain name?
OM The Eternity
2010-06-22 04:59:10
It's in the spec, http://tools.ietf.org/html/rfc2965: "[the hostname string] is a [Host Domain Name] string and has the form NB, where N is a non-empty name string, B has the form .B', and B' is a HDN string."
Paolo
2010-06-22 06:48:10