Jump to content

Sessions across domains


ryanh_106

Recommended Posts

Hey,

I want people to be able to log into my forum (which is stored on a sub-domain) and then switch over to the main website and still be recognised. However as sessions are only active while you remain on the same domain, I cant get this to work. Surely there must be some way to set for which domains the session is active. Any ideas? Any suggestions are much appreciated

Ryan
Link to comment
Share on other sites

The easiest way is to save your session data into a database allong with the session id and an ip. Then, pass the session id via the url to the second domain, from here, use the id to pull the infomation back out of the database and into a new session specific to that domain.
Link to comment
Share on other sites

Hmmm, I thought it was going to involve something like that, kinda defies the point of redirecting to the forum login page at all I may as well just work out exactly what the forum does to log someone in, and duplicate it on my site.

But then, when they move over to the forums, they wont be logged in...... damnit this is going to take more thought than i can manage so early in the day!

Thanks for the advise guys
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.