/    Sign up×
Community /Pin to ProfileBookmark

Session variables across domains

I have a website and I want the user to log in on a https:// page and then go back to a normal http:// page (no SSL). The secure pages on this server are under a different domain — so it’s like this:

Normal page:
[url]http://mydomain/page.php[/url]

Same page, secure:
[url]https://secure.theirdomain/mydomain/page.php[/url]

So is there a way to keep session variables across those domains? If I go to a secure page it says I’m logged in, but on the same page unsecured, it’s not logged in.

Thanks

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyAug 22.2005 — if the information that is being passed from secure to non secure isnt sensitive put it in the url and get it from the unsecure page. or maybe cookies.
Copy linkTweet thisAlerts:
@bokehAug 22.2005 — if the information that is being passed from secure to non secure isnt sensitive put it in the url and get it from the unsecure page. or maybe cookies.[/QUOTE]You cant use cookies or sessions because the domains are different. I would go with the url suggestion. Assign a unique query string to the client and store that ID in MySQL along with any other client info you gathered.
×

Success!

Help @hokietoner spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...