steviez Posted April 17, 2008 Share Posted April 17, 2008 Hi, I am trying to use a session login script but everytime i login and try to go to my.domain.com/index.php it redirects me to the login page as if the session was not set... but if i go to www.mydomains.com/index,php it works fine as it should. Any ideas? Thanks Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted April 17, 2008 Share Posted April 17, 2008 Are you calling session_start() at the top of ALL your pages? Quote Link to comment Share on other sites More sharing options...
steviez Posted April 17, 2008 Author Share Posted April 17, 2008 yes, like i say.. if i access the page via www. it works but if i access it via a sub url it wont. Quote Link to comment Share on other sites More sharing options...
mofm Posted April 17, 2008 Share Posted April 17, 2008 i dont think ther is anything wrong wioth the code but if u post it i can tell you ... maybe its somethinging to do with the server ? Quote Link to comment Share on other sites More sharing options...
steviez Posted April 17, 2008 Author Share Posted April 17, 2008 the code works the same on 2 different servers. I think it is a sub domain thing? Quote Link to comment Share on other sites More sharing options...
mofm Posted April 17, 2008 Share Posted April 17, 2008 ur asking us to help you on somthing that we havnt sen i.e help me my code dont work the page comes up black whats wrong ..... show us swher ur code is going worng and you may get a fix thanks mofm Quote Link to comment Share on other sites More sharing options...
steviez Posted April 17, 2008 Author Share Posted April 17, 2008 All fixed now, i had to add this line of code to the top of my script so it worked accross the whole of my site: <?php ini_set("session.cookie_domain", ".mydomain.com"); ?> Thanks Quote Link to comment Share on other sites More sharing options...
revraz Posted April 17, 2008 Share Posted April 17, 2008 Sounds like you had some absolute paths in your code for redirects instead of relative. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.