session-variables

How to redirect user based on dropdown selection of master page using session?

不羁的心 提交于 2019-12-12 12:35:54
问题 I have a dropdown on my master page which contains departments list.Now i have several pages which displays list of records based on department selection and change. So when user select new department from dropdown I make an AJAX call to my MVC controller and send department id to that controller and store it in session and used that session across all the pages as because all my pages are department driven. Implementation: @{ int departmentId = 0; int.TryParse(Convert.ToString(Session[

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 */ }

JavaScript code in source doesn't reflect code that is actually executed

眉间皱痕 提交于 2019-12-12 06:54:13
问题 My javascript code appears to work as it's supposed to. However, when I 'view source' in Chrome, it disagrees with the javascript that is actually executed. Here is my code: <?php $_SESSION['new'] = "blue"; if (!isset($_SESSION['old'])) { $_SESSION['old'] = "blue"; } echo '<script type="text/javascript"> $(document).ready(function() { changeCol("'.$_SESSION["old"].'","'.$_SESSION["new"].'"); }); </script>'; $_SESSION['old'] = "blue"; ?> $_SESSION['old']="green" from the previous page. The

Setting a session variable before AutoPostBack fires in an asp:Button

六月ゝ 毕业季﹏ 提交于 2019-12-12 05:27:22
问题 How would I go about setting a session variable from the click of an ASP:Button before an AutoPostBack event fires. Here is what I have right now, but I'm not exactly sure I'm doing this right: <asp:Button ID="CommitBTN" runat="server" PostBackUrl="~/MMR_Home.aspx" onclick="CommitBTN_Click" UseSubmitBehavior="true" OnClientClick='<% string temp1 = "true"; Session["ClickedFlag"] = temp1; %>' Text="Commit Changes to Database" /> Would this be the correct way of performing this action or am I

can't get SOME session variables across pages

时光总嘲笑我的痴心妄想 提交于 2019-12-12 05:00:02
问题 Trying to add some extra elements to my session variables for filesystem directory work, and I noticed that I can't add some. Here's what I have: <?php #login.php // This page processes the login form submission. // Upon successful login, the user is redirected. // Two included files are necessary. // Check if the form has been submitted: if(isset($_POST['submitted'])) { // For processing the login: require_once ('login_functions.php'); // Need the database connection: require_once ('..

In Rails4 How to assign variables in one controller action and use the value of it in another controller action

冷暖自知 提交于 2019-12-12 04:58:17
问题 using Ruby on Rails 4, I have a UI where the user can select a video file from a directory path on a server. They then click a button that runs media info on the file and displays the xml for the video along with parsing certain data values from the xml and assigning the value to @variables and displaying it back in the UI html page. This is all done in the action/method 'evaluate media'. When the page loads back it determines if this file has been saved or not and allows the user to save the

Resetting the session variable in php

浪尽此生 提交于 2019-12-12 04:57:39
问题 I have the following form on "test.php". <?php session_start(); if(isset($_POST['ph'])) if(isset($_POST['submit'])) $_SESSION['ph'] = $_POST['ph']; ?> <!doctype html> <html lang="en"> <body> <form method="POST" action="order.php" id="custphoneform"> <label for="PhoneNumber">Enter Phone Number:</label> <input type="number" name="ph" required> <input type="submit" value="Submit" name="submit"> </form> </body> </html> The "order.php" looks like this: <?php require 'connection.php'; session_start

wp_session variables being overwritten by $_POST

为君一笑 提交于 2019-12-12 04:47:06
问题 I am trying to post a form to $wp_session which is working fine - however when I perform it again it overwrites the array that I have put there in the first place, I need the arrays to carry on building up like a collection / shopping basket. My form: <form class="form1" method="post" action="" id="form1"> <fieldset> <ul> <label for="name">Exercise ID</label><span> <input type="text" name="ExerciseID" placeholder="Exercise ID" class="required" role="input" aria-required="true"/></span> <label

Why don't ASP.Net handlers support session by default

别等时光非礼了梦想. 提交于 2019-12-12 04:38:18
问题 I understand that in order for a ASP.Net handler to support session state you need to implement both IHttpHandler and IRequireSessionState , but why isn't session state provided by default? If for performance reasons, then wouldn't it be better to have an interface like IDoesNotRequireSessionState ? 回答1: Its because the session is block the asynchronous operations, and the handle is usually used for long time operations, like the making and download of a file - if you keep the session on long

Determining if a variable is set in an included file in PHP [duplicate]

前提是你 提交于 2019-12-12 03:57:18
问题 This question already has answers here : “Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP (28 answers) Closed 3 years ago . not sure if I have a unique problem or just haven't been able to hit the right terms on google to find it, but my problem is dealing with an undefined variable and not being able to check it. Across my site for menus I include a php file with all the menu stuff in it, then echo out the various parts as needed. My problem