session-variables

Cookie vs. Session based flash message

人盡茶涼 提交于 2019-12-22 04:00:31
问题 A neat feature which I found in CakePHP was the ability to set a flash message, say on some save script, then have that message displayed on the following page. Something like, Post updated , or Error - no file found. The way Cake does it is with this session object. I am trying to avoid sessions like the plague because of their odd requirements for scalability. Can I not just simply store the flash message in a cookie (client side) and then delete that cookie once it's displayed on the

PHP Session storing behavior into variables?

前提是你 提交于 2019-12-21 21:42:33
问题 this is only happening in Chrome Has anyone ever experienced PHP sessions storing functional behavior into variables? I created the following script: <?php session_start(); $_SESSION['count'] = (isset($_SESSION['count'])) ? $_SESSION['count'] + 1 : 0; echo $_SESSION['count']; ?> You'd think this would echo 0, 1, 2, 3, etc. on each page load. However, I'm getting 1, 3, 5, 7, and so on. I found out that for some reason, $_SESSION['count'] acts as though its incrementing behavior has been stored

SQL “SELECT IN (Value1, Value2…)” with passing variable of values into GridView

血红的双手。 提交于 2019-12-21 17:51:48
问题 I have a strange encounter when creating a GridView using SELECT..WHERE..<field> IN (value1, val2...) . In the "Configure datasource" tab, if i hard code the values SELECT .... WHERE field1 in ('AAA', 'BBB', 'CCC') , the system works well. However, if I define a new parameter and pass in a concatenated string of values using a variable; be it a @session, Control or querystring; e.g. SELECT .... WHERE field1 in @SESSION the result is always empty. I did another experiment by reducing the

ASP.Net Session data lost between pages

落花浮王杯 提交于 2019-12-21 12:23:56
问题 I came across a weird behavior today w/ my web application. When I navigate from a page to another, I lose one particular session variable data. I'm able to launch the app in firefox and able to see that the session data is not lost. I use Response.Redirect(page2, false) to redirect to another page. Below code was used to track session variables System.IO.StreamWriter sw = new System.IO.StreamWriter(@"c:\test.txt", true); for (int i = 0; i < Session.Count; i++) { sw.WriteLine(Session.Keys[i]

How to Persist data using session variable in mvc3 razor view?

故事扮演 提交于 2019-12-21 12:06:52
问题 I am working in MVC3 Application with Razor. In my Account controller after validating the user, i am getting the user ClientID from Database. Here i want to persist ClientID in Session variable. which was using across the all controller and Razor view. I have no idea as to what is the best way to implement this.OR How to persist data in the session variable. And how to use persisted data in the session variable in across the controller. Thanks for your help.. 回答1: If you are using ASP.NET

How to get ELMAH to include session values?

痴心易碎 提交于 2019-12-21 04:07:11
问题 NOTE: I know the various reasons to avoid using the session, but this is a project I've inherited, so please skip that part of any replies :) Since it's a solved problem, I'm hoping someone can point to an ELMAH patch/branch/fork that includes logging session data rather than reinventing the wheel. One weird thing is an older post from Atif that says they're already logged: http://markmail.org/message/ncmdgwm5rmzewbwu commenter henningst mentioned adding in the session variables here: http:/

How to go back to referer page in CakePHP after login

不想你离开。 提交于 2019-12-20 23:23:33
问题 I have a problem on going back to referer page: first url: http://site.com/venue/apartments/1564/venue-name referer url: null In this page I can edit stuff inside, so I have a login button to go to the login page, after a successful login, I would like to turn back to the first url . second url: http://site.com/users/login referer url: http://site.com/venue/apartments/1564/venue-name when I try to login, due to the CakePHP action rules, i have to refresh the login page to check the

Asp.net session variable

时间秒杀一切 提交于 2019-12-20 18:28:17
问题 I have a asp.net project with c# code behind. I have a static class called GlobalVariable where I store some information, like the currently selected product for example. However, I saw that when there are two users using the website, if one changes the selected product, if changes it for everybody. The static variables seem to be commun to everybody. I would want to create (from the c# code) some kind of session variable used only from the c# code, but not only from the page, but from any

PHP Notice: Use of undefined constant [duplicate]

跟風遠走 提交于 2019-12-20 07:56:27
问题 This question already has answers here : What does the PHP error message “Notice: Use of undefined constant” mean? (9 answers) Closed 3 years ago . I have a strange error message after using the post to wall function. It did successfully post to the wall however i got a very weird strange error. [Mon Dec 28 12:47:36 2015] [error] [client 5.29.224.120] PHP Notice: Use of undefined constant female - assumed 'female' in /datas/vhosts/nf.com/httpdocs/agence1948/result.php on line 178, referer:

$_SESSION variable not passing and no clue why? it sets then doesn't pass

戏子无情 提交于 2019-12-20 07:35:36
问题 I have a login script coded in php and mysqli. upon submission and successful authentication it redirects to success.php to write sessions. my success page looks like this. <?php /** * Set cookies here if/as needed. * Set session data as needed. DO NOT store user's password in * cookies or sessions! * Redirect the user if/as required. */ $id = $_GET['id']; $_SESSION['partner_id'] = $id; $_SESSION['authenticated'] = TRUE; if (isset($_SESSION['partner_id'])) { echo("<script> <!-- location