views:

26

answers:

2

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
+1 Sometimes I feel that GOD forgot to script the conflict script script for my silly brain :) thanxxxx cmendoza
OM The Eternity
+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
+1 Grt!!! I learnt something new on my silly question :) thanks Paolo
OM The Eternity
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
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