簡體   English   中英

https上的Login.php包含在http頁面上

[英]Login.php on https include on http page

我只是將我網站上的帳戶功能更改為SSL。

現在,http網站已在正常的http網站和https之間拆分,位於一個名為ssl.website的子域中。

僅在我的網站上使用http,在使用php會話登錄后,我使用的PHP腳本顯示了帳戶鏈接和選項。 現在,它僅顯示ssl.website上的內容,並且當我轉到http時,即使它們仍在https上登錄,登錄屏幕也會更改為“登錄”選項。

請參閱下面的我的PHP代碼。

我怎樣才能解決這個問題。 是否可以在所有http頁面上包含https login.php文件,以便它在登錄后讀取會話? 還是應該解決這個問題? 我嘗試了Google,但是沒有任何點擊顯示出與我相同的問題。

    <div id="right_column">
    <?php if(!isset($session_account)){ ?>
        <div id="accountcolumn">
        <ul>
        <li>
        <h3>Account</h3>
        <form method="post" action="https://ssl.website.com/login">
        <table>
                    <tr>
        <td>&nbsp;</td>
        </tr>
                    <tr>
        <td>E-mail:</td>
        </tr>
        <tr>
        <td><input type="text" name="email" style="width:140px"/></td>
        </tr>
        <tr>
        <td>Password:</td>
        </tr>
        <tr>
        <td><input type="password" name="password" style="width:140px" /></td>
        </tr>
                    <tr>
        <td><input type="submit" name="login" value="Login" /></td>
        </tr>
        </table>
                </form>
                </li>
        </ul>
    </div>
    <?php }else{ ?> 
    <div id="accountcolumn_login">
        <ul>
        <li>
        <h3>Account</h3>
        <form method="post" action="<?= $config['url']; ?>client/login">            
        <ul>
                    <li><a href="https://ssl.website.com/overview">Overview</a></li>
                <li><a href="https://ssl.website.com/shoppingbasket">Change account</a></li>
    <li><a href="https://ssl.website.com/password">Change password</a></li>
                </ul>
        </li>
        </ul>
    </div>
    <?php } ?>

您要么必須使用Cookie,要么使您的PHP-SESSION“傳播”到子域中,如下所示:

php.ini:

session.cookie_domain = ".website.com"

PHP:

ini_set('session.cookie_domain', '.website.com' );

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM