sessionid

How can I get $_SESSION data from SESSID?

梦想与她 提交于 2019-12-12 10:37:39
问题 I have a PHP websocket server (https://github.com/lemmingzshadow/php-websocket/). When an user connects, I want to set/get some session data. The problem is that I can't use $_SESSION because if I do that, instead of clients' session I get the session of my websocket server. I have managed to get clients' SESSID: private function handshake($data) { $this->log('Performing handshake'); if(preg_match("/PHPSESSID=(.*?)(?:;|\r\n)/", $data, $matches)){ $sessid = $matches[1]; } /* Do handshake */ }

PHP How can I calculate length of Session ID before starting session

不羁的心 提交于 2019-12-12 10:04:39
问题 How can I calculate length of PHP session id, based on php.ini values session.hash_function and session.hash_bits_per_character, and before starting the session. I want to create and assign custom session id like session_id($customSessionId); , before starting session. In my local machine value of session.hash_function is 0 (possible values are '0' for MD5 and '1' for SHA-1) and value of session.hash_bits_per_character is 5 (possible values are '4' [0-9, a-f], '5' [0-9, a-v], and '6' [0-9, a

Share session ID from CLI to browser

做~自己de王妃 提交于 2019-12-12 02:15:01
问题 I have a websocket connection from the browser to a php script running as a websocket server on CLI. I have the client send its session_id that was on the server i know which user has which session. It works perfectly to read the $_SESSION of the individual users. i do (on the server side [my CLI code]): $sess_ini = ini_get('session.save_path'); $save = file_get_contents("$sess_ini/sess_$sessionID"); session_id($sessionID); $sessions = explode("|",$save); $_SESSION['values'] = (isset(

window.open() clears session

耗尽温柔 提交于 2019-12-11 18:54:31
问题 I have several portlets in my application. If I open a url using window.open() method, the session id changes and causes an error in other portlets. If I don't open this url, everything works fine. But once this new window is opened, the session is cleared and the rest of the portlets throws an exception since some values are missing. In the address bar of the browser I typed in javascript:alert(document.cookie); to see the JSESSIONID. It remains constant throughout the page and changes when

Send userId at java web start from web page

孤街醉人 提交于 2019-12-11 18:22:11
问题 I'm developing a JSF2 site where the users may start a java application through java web start. The app parses mp3 metadata and sends back a xml file with the parsed information. I need some way of identifying the user for each file that is sent to the server and I have not been able to figure out how to do this. In other words the goal is to be able to set the userId in the xml file before the user sends it to the server. In order to do that, I need to somehow have that Id available in the

Session Hijacking Prevention in Java (Struts 2.0) | Error Encountered

删除回忆录丶 提交于 2019-12-11 14:27:58
问题 I'm developing an application in Java which seems to have a session hijacking vulnerability. In order to prevent this, the recommendation is to change the JSESSION ID for a user after log in My application is based on Struts 2.0 and Tomcat 7 and I have implemented a code to change the JSESSIONID after the user logs in. However i am facing the following problem while running the code. java.lang.IllegalStateException: setAttribute: Session already invalidated at org.apache.catalina.session

session_start() creates new session every refresh [duplicate]

夙愿已清 提交于 2019-12-11 10:18:27
问题 This question already has answers here : How to fix “Headers already sent” error in PHP (11 answers) Closed 6 years ago . I am having an issue with session_start() . It is creating a new session every refresh/load of the page. here is the code: <?php $bob = session_id(); echo "Session ID on load is ".$bob; echo "<br>"; if($bob==""){ session_start(); $bob = session_id(); echo ' session ID currently is '.$bob; } // a bunch more stuff when i load the page, I get the following: Session ID on load

RemotePlaybackClient resume session on Chromecast

半世苍凉 提交于 2019-12-11 06:46:31
问题 I am trying to use the RemotePlaybackClient to resume a Chromecast session created by the same Android app. I'm able to use this RPC vs the full Cast SDK to play, pause, resume, seek, and stop playback on the Chromecast device. My current test is in closing the Android app and using the sessionId from the session to try to reload the app and resume control of the playback. Upon closing the Android app, we are not terminating playback or the session, it keeps going. Here is the code I'm using:

Is there a way to access HttpSession from EJB module?

一笑奈何 提交于 2019-12-11 06:38:36
问题 I'm currently in a need of getting session ID thus I need to get the HttpSession but I don't have any servlets in my EJB module. So perhaps some DI annotation like in webservices api? 回答1: The EJB technology doesn't rely on HTTP so there is absolutely no reason to have HTTP specific stuff in the EJB API. If you need the session id from an EJB (wondering why), pass it as parameter from the web tier (technically, you could even pass the reference to the HttpRequest or the HttpSession objects

nodejs tls session id

这一生的挚爱 提交于 2019-12-11 03:31:47
问题 I am using TLS to create session using node.js library. Node.js does it provide a way to retrieve session id of TLS connection established. It is part of SSL ctx in openssl. Can it be done without using connect, express or geddy? 回答1: Unfortunately I don't think that information is exposed from the SSL context for node connections. You can access the node object representing the context as follows: var con = tls.connect(..., ...); con.pair.credentials.context Unfortunately, the only methods