Jump to content

Archived

This topic is now archived and is closed to further replies.

fedematarrita

Sessions crossing between http and https

Recommended Posts

Hi everyone, I this small section of my site where you have to be logged to be able to see it, the login and the section is over http, when the person logs in, I set a session var to tell me that the guy has log in, if the some one clicks on a link to a page that is on the http(not logged part) and on that page, they click back to the page that needs to be logged to be viewed, aperently the session var is not alive on the http side because I get the login page and not the other one.

what I'm doing is, after a succesfull login I set session_register("loginid"); and on the header of all the pages I do something like 
session_start();
if (session_is_registered('loginid))
{
$logged=1;
}

.....

and on the menu links:
if(isset($logged) && $logged==1)
echo "link to https page";
else
echo"link to http page";


it works correctly on the pages that are on the https side, but not on the http pages, what I'm doing wrong? or is it that sessions vars cant be set on https and used on http ? ??? ???

I will apreciate and will be thankful to any one that helps

Peace!!

Share this post


Link to post
Share on other sites
It's mainly firefox that doesn't cross session info between https and http, what you can do is set two sessions, one in the http side and one in the https side (two files with 2 redirection), maybe that'll work.

Share this post


Link to post
Share on other sites

×

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.