duande8497 2015-07-17 06:22
浏览 83

身份验证,仅限html和Javascript

I have done this for browser but now I am developing a hybrid app. I need authentication, I can only use html and JavaScript, since Hybrid app does not support php code. How do I do it such that when app starts it checks, if user is logged on (either via sending a status check request to server, or suggest any other way possible, if php code was possible to use i would check for some session variables and redirect based on that). If user is logged on send inside the app or else present login form. I cannot use Facebook, Google login etc in this case.

Thanks.

  • 写回答

1条回答 默认 最新

  • dqtdz08206 2015-07-17 06:26
    关注

    PHP is serverside, you could not have used it "for browser" except on the web server. You would use it for your hybrid app in exactly the same way - on the web server, and not inside your hybrid app. In your hybrid app, you would have an AJAX call, for example, contacting your server for authentication and persistence. It does not need to be PHP, but it does need to be a serverside executable.

    You need the server primarily because it makes no sense to even ask if the user is logged in unless there is somewhere they can be logged into

    评论

报告相同问题?

悬赏问题

  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码