search

Home  >  Q&A  >  body text

php - A solution to enable mobile browsing to support sessions

After the user successfully logs in, he goes to the main page, clicks to enter another page, and automatically jumps back to the login page to log in. What may be the reason? User information: There is a session after the user successfully logs in. This is a mobile website. It is probably caused by some mobile phones not supporting sessions. Is there any way to solve this problem?

伊谢尔伦伊谢尔伦2740 days ago805

reply all(4)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-27 17:45:59

    Find a few more test machines. In addition, Android webview requires permissions.

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-27 17:45:59

    In this case, you can put the sessionid in the URL as a parameter and pass it to the server, and use session_id() to forcefully specify the session id every time, but there will be security risks

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-27 17:45:59

    Session is saved on the server side, and there is no statement about whether the client supports it.
    Generally, the session ID is stored in cookies. If the client does not support cookies, the session will be invalid.
    I remember that PHP has a setting that can automatically put the session ID into the URL to solve the problem of the client closing cookies.
    Related information here.
    Good luck to you.

    reply
    0
  • 怪我咯

    怪我咯2017-05-27 17:45:59

    You can use LocalStorage and SessionStorage instead of Cookie

    reply
    0
  • Cancelreply