session-cookies

Check if cookies are enabled

南笙酒味 提交于 2019-11-26 02:08:00
问题 I am working on a page that requires javascript and sessions. I already have code to warn the user if javascript is disabled. Now, I want to handle the case where cookies are disabled, as the session id is stored in cookies. I have thought of just a couple ideas: Embedding the session id in the links and forms Warn the user they must enable cookies if they are disabled (would need help detecting if cookies are disabled) What is the best way to approach this? Thanks EDIT Based on the articles

PHP session lost after redirect

心不动则不痛 提交于 2019-11-25 23:57:57
问题 How do I resolve the problem of losing a session after a redirect in PHP? Recently, I encountered a very common problem of losing session after redirect. And after searching through this website I can still find no solution (although this came the closest). Update I have found the answer and I thought I\'d post it here to help anyone experiencing the same problem. 回答1: First, carry out these usual checks: Make sure session_start(); is called before any sessions are being called. So a safe bet

Invalidating JSON Web Tokens

我只是一个虾纸丫 提交于 2019-11-25 23:45:09
问题 For a new node.js project I\'m working on, I\'m thinking about switching over from a cookie based session approach (by this, I mean, storing an id to a key-value store containing user sessions in a user\'s browser) to a token-based session approach (no key-value store) using JSON Web Tokens (jwt). The project is a game that utilizes socket.io - having a token-based session would be useful in such a scenario where there will be multiple communication channels in a single session (web and

PHP Session Fixation / Hijacking

女生的网名这么多〃 提交于 2019-11-25 22:45:38
问题 I\'m trying to understand more about PHP Session Fixation & hijacking and how to prevent these problems. I\'ve been reading the following two articles on Chris Shiflett\'s website: Session Fixation Session Hijacking However, I\'m not sure I\'m understanding things correctly. To help prevent session fixation is it enough to call session_regenerate_id(true); after successfully logging someone in? I think I understand that correctly. He also talks about using tokens passed along in urls via $