Session Cookies and Domains

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Session Cookies and Domains

Post by neophyte »

I'm having a problem. Session cookies that are set for:

http://mydomain.com/whatever

Are not available to my script for

https://secure.mydomain.com/whatever

Visitors are asked to login in http://mydomain.com/whatever. During the application process they are asked to make a payment. For which they are redirected to https://secure.server.com/whatever. However the security on the page checks for $_SESSION variables. But because they were created on http://mydomain.com/whatever I can't use them in https://secure.mydomain.com/whatever. Does anybody have a suggestion?

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

  1. use database sessions.
  2. pass the session id via the url to the secure page
:?:
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Feyd's a genius!

Thanks for the tip Feyd.
Post Reply