session

How are CSRF tokens stored on the server side ( by spring security or tomcat)

a 夏天 提交于 2020-12-15 01:42:12
问题 This question is not about how CSRF tokens works, but is rather about they are stored on the server side. In short, CSRF tokens are generated by server and injected in to the web page/form. When the form is submitted the csrf token is extracted by the server and compared to the one saved on the server. So far so good. From this earlier posting - CSRF token value when same page is opened in two tabs on same machine? Here's the excellent answer which explains that - The server will create a

php session not working with ajax

痴心易碎 提交于 2020-12-13 11:07:30
问题 I've got a weird problem were php session variables are not working on pages accessed by ajax. Server Side Code: s2.php <?php session_start(); header("Access-Control-Allow-Origin: *"); echo '{"response":"'.$_SESSION["email"].'"}'; exit(); ?> Client Side Code: index.php $.ajax({ url: 'mysite.com/s2.php', data: info, error: function() { console.log("broke :( "); }, dataType: 'json', success: function(data) { console.log(data); }, type: 'POST' }); when I navigate to mysite.com/index.php i see:

php session not working with ajax

青春壹個敷衍的年華 提交于 2020-12-13 11:04:06
问题 I've got a weird problem were php session variables are not working on pages accessed by ajax. Server Side Code: s2.php <?php session_start(); header("Access-Control-Allow-Origin: *"); echo '{"response":"'.$_SESSION["email"].'"}'; exit(); ?> Client Side Code: index.php $.ajax({ url: 'mysite.com/s2.php', data: info, error: function() { console.log("broke :( "); }, dataType: 'json', success: function(data) { console.log(data); }, type: 'POST' }); when I navigate to mysite.com/index.php i see:

PHP form key bug

对着背影说爱祢 提交于 2020-12-12 05:55:57
问题 Can someone look at my two functions below and suggest what I can do? I have created two functions that basically creates a unique key and this is echoed in a hidden field in a form and then straight after I check if the form has been submitted the second function checks to see if the key in the hidden field matches the key in the session. The problem I am having is now and again it just redirects me to to the forbidden page suggesting the keys don't match although I have not edited the form

PHP form key bug

99封情书 提交于 2020-12-12 05:54:16
问题 Can someone look at my two functions below and suggest what I can do? I have created two functions that basically creates a unique key and this is echoed in a hidden field in a form and then straight after I check if the form has been submitted the second function checks to see if the key in the hidden field matches the key in the session. The problem I am having is now and again it just redirects me to to the forbidden page suggesting the keys don't match although I have not edited the form

Chrome not keeping my _SESSION vars when coming from 3rd-party IFRAME but works perfectly when accessed directly

耗尽温柔 提交于 2020-12-11 03:19:03
问题 Until a few weeks, all my sites were working perfectly . I write code and sell it on CodeCanyon. But recently (today) I've noticed that I cannot log in anymore to my little PHP snippets of code that I have on sale there. If I work directly on my domain, as in typing the link in the URL bar, everything works perfect, in any browser ( meaning, all my _SESSION vars are kept, all throughout ). But when I do check my snippets of code ( all using password-protection and _SESSIONS var , on

Chrome not keeping my _SESSION vars when coming from 3rd-party IFRAME but works perfectly when accessed directly

走远了吗. 提交于 2020-12-11 02:54:34
问题 Until a few weeks, all my sites were working perfectly . I write code and sell it on CodeCanyon. But recently (today) I've noticed that I cannot log in anymore to my little PHP snippets of code that I have on sale there. If I work directly on my domain, as in typing the link in the URL bar, everything works perfect, in any browser ( meaning, all my _SESSION vars are kept, all throughout ). But when I do check my snippets of code ( all using password-protection and _SESSIONS var , on

Chrome not keeping my _SESSION vars when coming from 3rd-party IFRAME but works perfectly when accessed directly

久未见 提交于 2020-12-11 02:54:22
问题 Until a few weeks, all my sites were working perfectly . I write code and sell it on CodeCanyon. But recently (today) I've noticed that I cannot log in anymore to my little PHP snippets of code that I have on sale there. If I work directly on my domain, as in typing the link in the URL bar, everything works perfect, in any browser ( meaning, all my _SESSION vars are kept, all throughout ). But when I do check my snippets of code ( all using password-protection and _SESSIONS var , on

Chrome not keeping my _SESSION vars when coming from 3rd-party IFRAME but works perfectly when accessed directly

大兔子大兔子 提交于 2020-12-11 02:54:14
问题 Until a few weeks, all my sites were working perfectly . I write code and sell it on CodeCanyon. But recently (today) I've noticed that I cannot log in anymore to my little PHP snippets of code that I have on sale there. If I work directly on my domain, as in typing the link in the URL bar, everything works perfect, in any browser ( meaning, all my _SESSION vars are kept, all throughout ). But when I do check my snippets of code ( all using password-protection and _SESSIONS var , on

How to disallow multiple parallel user sessions per login in ZF2?

感情迁移 提交于 2020-12-06 11:32:47
问题 I'm currently facing the situation, that the ZendFramework2 ZFCuser-Module does not have any options to prevent a user from logging in from two devices at the same time. We recently had a case, that two people were "account-sharing" and accidentally deleted each others data. Since I did not build the application to account for this kind of resource conflicts, I need to prevent this behaviour now. Is there any module or easy possibility out there to prevent account-sharing in Zend Framework 2