使用PHP在Android WebView中设置Cookie

时间:2018-03-31 12:31:16

标签: php android cookies webview

我有一个使用WebView调用PHP网站的应用程序。每当有人登录时,我都会使用以下PHP代码设置cookie:

Select Food:
        <select id="dropdownList" name="dropdownList" onchange="getSelectValue();">
            <option value="Prawn Aglio Olio">Prawn Aglio Olio</option>
            <option value="Carbonara">Carbonara</option>
        </select>
        <br>
    
        Select Quantity:
        <input type="number" id="amount_1"   onchange="getSelectValue();">
        <br>
    
        Price per unit:
        <input type="text" id="price_1" value="" disabled>
    
        <br>
        <br>
        
        <!-- Second Selection -->
        Select Food:
        <select id="dropdownList2" name="dropdownList2" onchange="getSelectValue();">
            <option value="">Prawn Aglio Olio</option>
            <option value="Carbonara">Carbonara</option>
        </select>
        <br>
    
        Select Quantity:
        <input type="number" id="amount_2"  onchange="getSelectValue();">
        <br>
    
        Price per unit:
        <input type="text" id="price_2" value="" disabled>
    
        <br>
    
        <input type ="button" value="Submit">
        <a href="vendor.jsp">
            <input type="button" value="Back">
        </a>
    </form>

在此之后,在应用程序中,我已经为cookie管理编写了以下行:

setcookie('id', $row['id'], time() + $time, "/");
setcookie('username', $row['username'], time() + $time, "/");

现在我已经尝试了堆栈溢出时给出的所有解决方案,但没有一个正在运行。请帮忙!

0 个答案:

没有答案