SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Apr 14, 2009, 07:31 #1
- Join Date
- Dec 2007
- Posts
- 120
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Problem with sessions after ISP moved my site to new server
Hello,
I'm having some sessions problems after my ISP moved my site to a new server, supposedly setup the same. The problem appears to be browser-specific as well, which I don't quite understand.
First, my site uses sessions to login, this has been broken since they moved the site.
My ISP has set up a test page at http://launchcomplex.com/loggedin_test1.php. When I hit this page in IE 6 (where it sets some session vars) and then hit the "header redirect" button, sessions seem to work fine. If I try it in Firefox/Opera, I get a new session id on the redirected page. My ISP reports sessions are working for IE as well, though I imagine they're using IE7 or perhaps even 8.
Everything was working fine on my site before my ISP moved it and while they've been very helpful in responding, they're at a loss as to why it's broken. A couple of other of my sites with them were broken along with the move, but they have been resolved by server tweaks...Does anyone have any ideas what's going on?
-
Apr 14, 2009, 07:38 #2
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
before calling session_start(), call
PHP Code:ini_set('session.cookie_domain', '.launchcomplex.com');
This tells the browser the cookie should be shared with all subdomains. You will need to do this on all pages which call session_start(), or you can just set this in php.ini or .htaccess
-
Apr 14, 2009, 07:42 #3
- Join Date
- Dec 2007
- Posts
- 120
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Would that explain why the sessions work for IE and not other browsers? That's what I can't figure out, it seems like it'd work for everyone or no one.
-
Apr 14, 2009, 07:52 #4
- Join Date
- May 2005
- Location
- India
- Posts
- 564
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Hi,
Try this:
Code:@ini_set ("session.use_cookies", 1); @ini_set ("session.use_trans_sid", 0); session_start(); $PHPSESSID = session_id();
Thanks.
-
Apr 14, 2009, 07:57 #5
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Bookmarks