session-variables

Session Best Practices

自作多情 提交于 2020-01-01 12:14:09
问题 Hi I use Sessions in my application and I was wondering what is the best practice for maintaining session value on a page. I need the value that is stored in the session to be saved until the post back on a particular page. Let me illustrate: Page A: Page B: Sets Session["ID"] = 5 --> Gets Session["ID"] And redirects to Page B and populates data. I need the Session["ID"] on Page B to stay alive until a post back is performed on Page B. I need this because I will be using the value of Session[

Facebook Login using HybridAuth showing error You cannot access this page directly

本小妞迷上赌 提交于 2020-01-01 05:50:50
问题 I am trying to write a plugin for my website to connect with facebook using the HybridAuth classes. I just tried following code function authenticatewith( $provider ) { ini_set('display_errors','on'); //includes $config = dirname(__FILE__) . '/hybridauth-2.1.2/hybridauth/config.php'; require_once("hybridauth-2.1.2/hybridauth/Hybrid/Auth.php"); $provider_name = $provider; //$config = $this->getconfig($id); try { // initialize Hybrid_Auth with a given file $hybridauth = new Hybrid_Auth($config)

PHP Session lost half way through buying process

你。 提交于 2019-12-31 05:28:11
问题 THE SET UP I have a buying process that has the following stages: results customer payment order-conf The results page sets a session variable with an ID from our orders database table. Each page posts data to the next one. The start of customer and payment BOTH check the existence of the ID number session variable. As you can imagine, 99% of browsers with default cookie settings have no problem with the setting of these sessions vars and reading them. I get an alert whenever that session var

Flask session forgets entry between requests

烂漫一生 提交于 2019-12-30 17:40:28
问题 I'm using the latest Flask/Werkzeug (Flask 0.9) client-side sessions to persist information between requests. The session is not set to be persistent (as I'm fine with the cookie being deleted when the browser is closed). My problem is as follows: I use some server-side code to fill the Flask session variable with an entry. After this, the Session variable looks something like this: <SecureCookieSession {u'items': SOMENOTVERYIMPORTANTDICTIONARY}, '_fresh': True, 'user_id': u'1', 'csrf':

Flask session forgets entry between requests

最后都变了- 提交于 2019-12-30 17:40:09
问题 I'm using the latest Flask/Werkzeug (Flask 0.9) client-side sessions to persist information between requests. The session is not set to be persistent (as I'm fine with the cookie being deleted when the browser is closed). My problem is as follows: I use some server-side code to fill the Flask session variable with an entry. After this, the Session variable looks something like this: <SecureCookieSession {u'items': SOMENOTVERYIMPORTANTDICTIONARY}, '_fresh': True, 'user_id': u'1', 'csrf':

Flask Session will not Persist

走远了吗. 提交于 2019-12-30 11:11:00
问题 I have recently deployed my first Flask application (first web application ever actually), one problem I am running into and haven't had luck tracking down is related to sessions. What I am doing is when the user logs in I set session['user'] = user_id and what is happening is I occasionally get a key error when making a request involving that session key. If I try to make the request again the session key is there and the request works fine. I have done research and set the app.config[

PHP Multiple Concurrent Sessions Per User

跟風遠走 提交于 2019-12-30 05:49:26
问题 I'm working on a web app using PHP on Apache. $_SESSION variables are used quite a bit for the information that must persist across pages. We need each user to be able to open multiple concurrent sessions, either as new tabs or new windows, depending on their choice of browser. Right now when a user opens an addition tab or window and goes to the site the existing session is adopted. How can I prevent this so that the user must (or may) log in and start a new session, without it interfering

Why is my SESSION array OK on one page but empty on another?

独自空忆成欢 提交于 2019-12-29 08:25:07
问题 I have a class that sets various session variables. After I set the session variable I do a var dump of SESSION and get an output of them all. all good so far. Then I navigate to another page. session_start(); // i call this right after opening the php tag var_dump($_SESSION); // i call this after setting the variables and it's empty this time? Setting my sessions while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)) { $_SESSION['atid'] = $row['autotaskid']; $_SESSION['bmsid'] = $row[

session variables timeout in asp.net app

♀尐吖头ヾ 提交于 2019-12-29 04:54:35
问题 In my web app I'm using some session variables, which are set when I login: e.g. Session("user_id") = reader("user_id") I use this through my app. When the session variable times out, this throws errors mainly when connecting to the database as session("user_id") is required for some queries. How can I set my session variables so that once they are timed out to go to the login page or how can at least increase the length of time the are available? 回答1: I'm guessing you're using Forms

php session variable lost

你。 提交于 2019-12-29 01:49:06
问题 I work with php5 and apache2 on my development machine. The production server is apparently similar. I have a script set_language.php that creates a session variable according to the language chosen: <?php session_start(); $back = $_SERVER['HTTP_REFERER']; if (isset($_GET['lang'])) { if ($_GET['lang'] == 'fr') $_SESSION['lang'] = 'fr'; else if ($_GET['lang'] == 'en') $_SESSION['lang'] = 'en'; } header( "Location: $back" ) ; exit(); ?> Then I include the code below on all pages: session_start(