I have a session variable that I set like this:
<?php
$token = md5(uniqid(rand(), true));
session_start();
$_SESSION['token'] = $token;
print $_SESSION['token'];
?>
Then on another page I have this:
<?php
session_start();
print $_SESSION['token'];
?>
The problem is that they don't match. I get two completely different strings. regi...
I'm currently working on solving a bug with a site I've been working on for some time now. The issue I'm having is my session objects are being overwritten occasionally when users call the site at the same time.
My current session mode is In-Proc and after reading another thread regarding a similar issue I believe my problem may be rela...
I'm trying to be clever by allowing a small validation method to be defined "inline" in ASCX templates as an Action<,>, like so:
<%= OnValidation(delegate(FormSubmission form, FormResult errors) {
// form checks in here, append errors to errors variable if required
}) %>
It actually works a treat, but in order to ensure it can be ...
Hi,
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...
Hi,
I use a content management system called liferay that lets you add iframes to a page very easily. I have various different iframes that i want to use the same php session variables. This wouldn't be an issue if the main webpage was setting the sessions. the problem is the sessions are created in one iframe and I'm wanting to use the...
I am making a news add form using post method. In the second page i make data validation. I define the variables like $message = $_POST["message"] and after that $_SESSION['message'] = "$message"; after that I echo the session var and everything look fine the data appear. And when I click to send which go to another page to add the data ...
Take a look at this code:
System.Web.SessionState.HttpSessionState ss = HttpContext.Current.Session["pdfDocument"] ?? false;
if ((Boolean)ss)
{
Label1.Text = (String)Session["docName"];
}
Basically I want to check if HttpContext.Current.Session["pdfDocument"] is not null, and if it isn't to cast to...
I have a web app running Spring 3.0 and using Spring-MVC. I have a few controllers set up like this:
@Controller
@RequestMapping("/admin")
@SessionAttributes({"clientLogin", "selectTab", "user", "redirectUrl"})
public class AdminController {
...
}
@Controller
@SessionAttributes({"clientLogin", "selectTab", "user", "redirectUrl"})
publi...
if(isset($_POST['submit'])){
$eventSelect = $_POST['eventSelect'];
$eventLocation = $_POST['eventLocation'];
$eventDate = $_POST['eventDate'];
echo "Event Name:";echo $eventName;
echo "<br /><br />Event Location:";echo $eventLocation;
echo "<br /><br />From :"; echo $eventDate;
}
When a user goes to the site ...
I have a module in Drupal 6 that saves some information in the $_SESSION array. I use this information to customize some content in another page.
The problem is that when I'm not logged in Drupal, the information is not saved in the session. When I'm logged in, it works as expected.
Any ideas? Thanks.
...
Hi
I am using a session to maintain some variables between different pages on my site. While it works fine when I move from www.mysite.com/a to www.mysite.com/b, the session variables are lost if I move from mysite.com/a to www.mysite.com/b
Any idea how I can make sure the session is maintained irrespective of www or no www?
The websi...
Hello, I have a Spring controller which is putting a variable in the session:
public class LoginFormController extends SimpleFormController {
public ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command) throws Exception {
request.getSession().setAttribute("authenti...
I'm used to using VB.net for web programming.
Often, I have something like:
Dim s as string = Session("s")
I get a string value for s from the web session. If there is no value in the web session, I get a blank string.
However, AFAIK, in C#, I have to have something like the code below to do the same thing.
string s;
try { s = Ses...
Does anyone know how PHP maps session IDs to $_SESSION arrays? In other words, given session ID x, where does PHP pull the values from to populate the $_SESSION array?
And given a session ID and the url it came from, is there any possibility of someone being able to gain access to the values in the $_SESSION array?
...
Hi stackworld,
Well heres my question.
In my project im using a rest service to authenticate clients. That part is ok as I have used a simple authentication by hashing a user id and a password together. After the authentication I want to open to the users few other rest services through the modular scheme in zend framework.
I am curre...
Really quick and simple question but I can't find a decent answer to this - What is the best way to pass data from a controller to a block in Magento.
Incase it makes a difference, I am loading the layout as follows:
$this->loadLayout(array('default', 'myModule_default'));
$this->_initLayoutMessages('customer/session')
-...
i have a small application i am implementing with django and i'm having a slight challenge. I'm trying to limit the queryset for my relationships within my application by a particular property. Now the catch is, the exact value of the property isn't known until the user logs into the application. an example is limiting a set of comments ...
Sorry if this has been covered, I couldn't find anything specifically to this issue in my searches.
I am trying to debug a classic ASP application. I need to print the session variables, one of which is an array. My code is below, I keep getting Subscript out of range, usually this means that the array is empty (Ubound returns -1) but i...
Is it a bad idea to store a raw sql query in a php session variable for later use? Does this present any security issues?
...
I have a two tier architecture based website-data layer and UI layer. I have a web page, I get the id of a customer from the querystring and I build the customer object from that id. I have several tabs in my webpage, so, unless I need the data, I dont have to load the data for the grids which are in the tabs that are not clicked. That's...