Rectangle 27 6

in the strictest sense of the question, no, jQuery/javaScript can't access ColdFusion variables directly, Kevin B is correct. However, you can use AJAX (which is JavaScript, not jQuery, although jQuery has a few methods to make it easy) to send data to ColdFusion without having to do a full round trip in the browser. Doing so causes ColdFusion to create variables in the URL and FORM scopes depending on the method you choose. Unfortunately, FORM and URL variables only exist for the duration of the request so you would then use ColdFusion to set whatever SESSION variables you needed to set using the URL or FORM variables you just sent.

A very simple example of this may look like this jQuery:

<script>
   var myName = "Travis";
   $.get('setVariable.cfm?someVar='+myName, // Send a value to the server in the URL.
      function(data){ // tell the user what the server said (optional).
         alert(data);  //data is whatever was returned by the server.
      }
   );   
</script>

CF code in setVariable.cfm might look like

<cftry>
    <cfset session.userName = url.someVar>
    Session user was set.
    <cfcatch>
        <cfoutput>
            Oh, Crap! Something bad happened! (#cfcatch.message#)
        </cfoutput>
    </cfcatch>
</cftry>

Can I access ColdFusion session inside JQuery? - Stack Overflow

jquery coldfusion
Rectangle 27 16

You can write JSON into local storage and just use JSON.stringify (non-jQuery) to serialize a JavaScript object. You cannot write to any file using JavaScript alone. Just cookies or local (or session) storage.

var obj = {
    name: 'Dhayalan',
    score: 100
};

localStorage.setItem('gameStorage', JSON.stringify(obj));

And to retrieve the object later, such as on page refresh or browser close/open...

var obj = JSON.parse(localStorage.getItem('gameStorage'));

Thanks Works like charm :) but is there a limitation on the size of the file we can store in local storage ?

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

javascript - How to write data into a JSON file using jquery - Stack O...

javascript jquery json html5
Rectangle 27 16

You can write JSON into local storage and just use JSON.stringify (non-jQuery) to serialize a JavaScript object. You cannot write to any file using JavaScript alone. Just cookies or local (or session) storage.

var obj = {
    name: 'Dhayalan',
    score: 100
};

localStorage.setItem('gameStorage', JSON.stringify(obj));

And to retrieve the object later, such as on page refresh or browser close/open...

var obj = JSON.parse(localStorage.getItem('gameStorage'));

Thanks Works like charm :) but is there a limitation on the size of the file we can store in local storage ?

javascript - How to write data into a JSON file using jquery - Stack O...

javascript jquery json html5
Rectangle 27 7

The most RESTful way I have seen is based on the OAuth client credentials flow, basically a /token endpoint that you post username/password to which returns an access token for this session. Every ajax request after that appends an Authorization bearer header with the token. You can store the token in a global variable to just keep it around until the page is refreshed/closed, use local storage to keep users logged in between sessions, or javascript cookies. If you don't like the idea of tokens then you can just use the old cookie approach which is automatically send with any ajax request anyway.

As for facebook/google etc I normally follow the stackoverflow approach where I associate external userlogins to an account. Then use a fairly normal server based oauth dance (although you can replace all requests to the server with ajax requests with slight modifications, I just find it doesn't really make much difference as you need redirects between you and the server anyway). I normally issue an encrypted cookie for a facebook login, which I then convert into a token using a similar method as above (just send the cookie with the request instead of username/password).

javascript - Authentication for users on a Single Page App? - Stack Ov...

javascript authentication backbone.js javascriptmvc single-page-application
Rectangle 27 7

The most RESTful way I have seen is based on the OAuth client credentials flow, basically a /token endpoint that you post username/password to which returns an access token for this session. Every ajax request after that appends an Authorization bearer header with the token. You can store the token in a global variable to just keep it around until the page is refreshed/closed, use local storage to keep users logged in between sessions, or javascript cookies. If you don't like the idea of tokens then you can just use the old cookie approach which is automatically send with any ajax request anyway.

As for facebook/google etc I normally follow the stackoverflow approach where I associate external userlogins to an account. Then use a fairly normal server based oauth dance (although you can replace all requests to the server with ajax requests with slight modifications, I just find it doesn't really make much difference as you need redirects between you and the server anyway). I normally issue an encrypted cookie for a facebook login, which I then convert into a token using a similar method as above (just send the cookie with the request instead of username/password).

javascript - Authentication for users on a Single Page App? - Stack Ov...

javascript authentication backbone.js javascriptmvc single-page-application
Rectangle 27 1

If you are using the Facebook Javascript SDK, why don't simply call the logout method after you have destroy your session?

FB.logout(function(response) {
  // user is now logged out
});

php - Logout Facebook connection on website if using javascript sdk - ...

php facebook session facebook-graph-api facebook-javascript-sdk
Rectangle 27 3

This is a known issue in swfupload, you need to pass your session id in to the swfupload constructor and then recreate explicitly restart this session in your remote file using the session id you have passed like this:

// in your javascript file 
 swfu = new SWFUpload({
  upload_url: "http://<?=$_SERVER['HTTP_HOST']?>/scripts/swfupload2/upload.php",
  post_params: {"PHPSESSID": "<?=session_id()?>"}
 }

 // in your PHP file
 if (isset($_POST["PHPSESSID"])) {
  session_id($_POST["PHPSESSID"]);
 }

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

ajax - PHP Sessions and Javascript Callbacks - Stack Overflow

php ajax apache session swfupload
Rectangle 27 2

The problem with all these solutions, although correct, they are impractical, when taking into account the session timeout valuable set, using PHP, .NET or in the Application.cfc file for Coldfusion developers. The time set by the above solution needs to sync with the server side session timeout. If the two do not sync, you can run into problems that will just frustrate and confuse your users. For example, the server side session timeout might be set to 60 minutes, but the user may believe that he/she is safe, because the JavaScript idle time capture has increased the total amount of time a user can spend on a single page. The user may have spent time filling in a long form, and then goes to submit it. The session timeout might kick in before the form submission is processed. I tend to just give my users 180 minutes, and then use JavaScript to automatically log the user out. Essentially, using some of the code above, to create a simple timer, but without the capturing mouse event part. In this way my client side & server side time syncs perfectly. There is no confusion, if you show the time to the user in your UI, as it reduces. Each time a new page is accessed in the CMS, the server side session & JavaScript timer are reset. Simple & elegant. If a user stays on a single page for more than 180 minutes, I figure there is something wrong with the page, in the first place.

Yep, that's why I'm only doing this after getting rid of server side sessions and loading everything from html files.

Detecting idle time in JavaScript elegantly - Stack Overflow

javascript
Rectangle 27 2

The problem with all these solutions, although correct, they are impractical, when taking into account the session timeout valuable set, using PHP, .NET or in the Application.cfc file for Coldfusion developers. The time set by the above solution needs to sync with the server side session timeout. If the two do not sync, you can run into problems that will just frustrate and confuse your users. For example, the server side session timeout might be set to 60 minutes, but the user may believe that he/she is safe, because the JavaScript idle time capture has increased the total amount of time a user can spend on a single page. The user may have spent time filling in a long form, and then goes to submit it. The session timeout might kick in before the form submission is processed. I tend to just give my users 180 minutes, and then use JavaScript to automatically log the user out. Essentially, using some of the code above, to create a simple timer, but without the capturing mouse event part. In this way my client side & server side time syncs perfectly. There is no confusion, if you show the time to the user in your UI, as it reduces. Each time a new page is accessed in the CMS, the server side session & JavaScript timer are reset. Simple & elegant. If a user stays on a single page for more than 180 minutes, I figure there is something wrong with the page, in the first place.

Yep, that's why I'm only doing this after getting rid of server side sessions and loading everything from html files.

Detecting idle time in JavaScript elegantly - Stack Overflow

javascript
Rectangle 27 1

One way you can do this is using javascript to refresh the page a little after the timeout period. Granted your users will have to have Javascript enabled for this to work. You can also add extra features like having javascript pop up a timeout notice with a count down, etc. So essential what happens the session is expired due to your settings, then the refresh hits, clean up runs and your done.

<html>
<head>
<script type="text/JavaScript">
<!--
function timedRefresh(timeoutPeriod) {
    setTimeout("location.reload(true);",timeoutPeriod);
}
//   -->
</script>
</head>
<body onload="JavaScript:timedRefresh(5000);">
</body>
</html>

Yup, using a heartbeat is an option but in your example the "onUnload" event needs a good-bye function. And even then the expiry event would not be guaranteed if the useragent simply drops the connection. But judging from the accepted answer, Timo was not looking for a bulletproof way to execute custom code on the server when a session expires. I gather he was simply worried about session destruction.

PHP Session Expiration - Stack Overflow

php session
Rectangle 27 2

If you aren't using cookies to preserve your users' login information, it should log them out when they close the browser, because any session cookies should be killed when the browser closes.

Obviously this isn't always the case (see here for an example of Firefox preserving login information after logging out) because "session restore" features we now blur the line between what is considered a "single browser session". (Personally, I think this should be classified as a bug, but that is only my opinion).

There are two possible techniques. The first would be (as yojimbo87 mentions before me) to use web sockets to keep a connection between client and server, and when the socket closes, kill the session. The issue here is that web sockets support is limited, and certainly not possible on anything other than bleeding edge browsers (FF4, Chrome, IE9, etc).

An alternative could be to use AJAX to constantly poll the server to tell it that the page is still being viewed, so if, for example, you send a keep-alive request via AJAX every 30 seconds, you'd store the timestamp of the request in the session. If the user then comes back to the page and the time difference between the current request and the last request is more than say... 45 seconds (accounting for latency), you'd know that the user closed their browser and need to log in again.

In both of these situations, there is however a fatal flaw, and that is that they rely on JavaScript. If the user doesn't have JavaScript enabled, you'd end up ruining the user experience with constant login prompts, which is obviously a bad idea.

In my opinion, I think its reasonable to simply rely on session cookies being deleted by the browser when the user closes the browser window, because that is what they are supposed to do. You as a developer can't be blamed when the client browser performs undesirable behaviour, since its entirely out of your hands, and there's no functional workaround.

javascript - Is there a reliable way to log a user out when the browse...

javascript asp.net session asp.net-membership
Rectangle 27 1044

JSP is a Java view technology running on the server machine which allows you to write template text in client side languages (like HTML, CSS, JavaScript, ect.). JSP supports taglibs, which are backed by pieces of Java code that let you control the page flow or output dynamically. A well-known taglib is JSTL. JSP also supports Expression Language, which can be used to access backend data (via attributes available in the page, request, session and application scopes), mostly in combination with taglibs.

When a JSP is requested for the first time or when the web app starts up, the servlet container will compile it into a class extending HttpServlet and use it during the web app's lifetime. You can find the generated source code in the server's work directory. In for example Tomcat, it's the /work directory. On a JSP request, the servlet container will execute the compiled JSP class and send the generated output (usually just HTML/CSS/JS) through the web server over a network to the client side, which in turn displays it in the web browser.

Servlet is a Java application programming interface (API) running on the server machine, which intercepts requests made by the client and generates/sends a response. A well-known example is the HttpServlet which provides methods to hook on HTTP requests using the popular HTTP methods such as GET and POST. You can configure HttpServlets to listen to a certain HTTP URL pattern, which is configurable in web.xml, or more recently with Java EE 6, with @WebServlet annotation.

When a Servlet is first requested or during web app startup, the servlet container will create an instance of it and keep it in memory during the web app's lifetime. The same instance will be reused for every incoming request whose URL matches the servlet's URL pattern. You can access the request data by HttpServletRequest and handle the response by HttpServletResponse. Both objects are available as method arguments inside any of the overridden methods of HttpServlet, such as doGet() and doPost().

JSF is a component based MVC framework which is built on top of the Servlet API and provides components via taglibs which can be used in JSP or any other Java based view technology such as Facelets. Facelets is much more suited to JSF than JSP. It namely provides great templating capabilities such as composite components, while JSP basically only offers the <jsp:include> for templating, so that you're forced to create custom components with raw Java code (which is a bit opaque and a lot of tedious work in JSF) when you want to replace a repeated group of components with a single component. Since JSF 2.0, JSP has been deprecated as view technology in favor of Facelets.

As being a MVC (Model-View-Controller) framework, JSF provides the FacesServlet as the sole request-response Controller. It takes all the standard and tedious HTTP request/response work from your hands, such as gathering user input, validating/converting them, putting them in model objects, invoking actions and rendering the response. This way you end up with basically a JSP or Facelets (XHTML) page for View and a JavaBean class as Model. The JSF components are used to bind the view with the model (such as your ASP.NET web control does) and the FacesServlet uses the JSF component tree to do all the work.

<c:forEach>
<mytag:doesSomething/>
<jsp:attribute>

Since this is a hugely popular answer, I want to add a very important bit which is JSP tag files which allows for custom tag creation for page composition and layout without writing Java code. This feature is extremly useful and has been part of the standard for many years yet remains underutilized.

@johnny Facelets has been the preferred view technology since Java EE 6 was released in 2009 (docs.oracle.com/javaee/6/tutorial/doc/giepx.html). The minimum set of technologies to develop Java web apps isn't higher than most other languages, but there are many more options and competitors, which is confusing to newcomers. Web development in Ruby? The first choice is obvious.

java - What is the difference between JSF, Servlet and JSP? - Stack Ov...

java jsp jsf servlets java-ee
Rectangle 27 1041

JSP is a Java view technology running on the server machine which allows you to write template text in client side languages (like HTML, CSS, JavaScript, ect.). JSP supports taglibs, which are backed by pieces of Java code that let you control the page flow or output dynamically. A well-known taglib is JSTL. JSP also supports Expression Language, which can be used to access backend data (via attributes available in the page, request, session and application scopes), mostly in combination with taglibs.

When a JSP is requested for the first time or when the web app starts up, the servlet container will compile it into a class extending HttpServlet and use it during the web app's lifetime. You can find the generated source code in the server's work directory. In for example Tomcat, it's the /work directory. On a JSP request, the servlet container will execute the compiled JSP class and send the generated output (usually just HTML/CSS/JS) through the web server over a network to the client side, which in turn displays it in the web browser.

Servlet is a Java application programming interface (API) running on the server machine, which intercepts requests made by the client and generates/sends a response. A well-known example is the HttpServlet which provides methods to hook on HTTP requests using the popular HTTP methods such as GET and POST. You can configure HttpServlets to listen to a certain HTTP URL pattern, which is configurable in web.xml, or more recently with Java EE 6, with @WebServlet annotation.

When a Servlet is first requested or during web app startup, the servlet container will create an instance of it and keep it in memory during the web app's lifetime. The same instance will be reused for every incoming request whose URL matches the servlet's URL pattern. You can access the request data by HttpServletRequest and handle the response by HttpServletResponse. Both objects are available as method arguments inside any of the overridden methods of HttpServlet, such as doGet() and doPost().

JSF is a component based MVC framework which is built on top of the Servlet API and provides components via taglibs which can be used in JSP or any other Java based view technology such as Facelets. Facelets is much more suited to JSF than JSP. It namely provides great templating capabilities such as composite components, while JSP basically only offers the <jsp:include> for templating, so that you're forced to create custom components with raw Java code (which is a bit opaque and a lot of tedious work in JSF) when you want to replace a repeated group of components with a single component. Since JSF 2.0, JSP has been deprecated as view technology in favor of Facelets.

As being a MVC (Model-View-Controller) framework, JSF provides the FacesServlet as the sole request-response Controller. It takes all the standard and tedious HTTP request/response work from your hands, such as gathering user input, validating/converting them, putting them in model objects, invoking actions and rendering the response. This way you end up with basically a JSP or Facelets (XHTML) page for View and a JavaBean class as Model. The JSF components are used to bind the view with the model (such as your ASP.NET web control does) and the FacesServlet uses the JSF component tree to do all the work.

<c:forEach>
<mytag:doesSomething/>
<jsp:attribute>

Since this is a hugely popular answer, I want to add a very important bit which is JSP tag files which allows for custom tag creation for page composition and layout without writing Java code. This feature is extremly useful and has been part of the standard for many years yet remains underutilized.

@johnny Facelets has been the preferred view technology since Java EE 6 was released in 2009 (docs.oracle.com/javaee/6/tutorial/doc/giepx.html). The minimum set of technologies to develop Java web apps isn't higher than most other languages, but there are many more options and competitors, which is confusing to newcomers. Web development in Ruby? The first choice is obvious.

java - What is the difference between JSF, Servlet and JSP? - Stack Ov...

java jsp jsf servlets java-ee
Rectangle 27 1

Instead of jquery/ajax calls to keep the session alive, you may consider using javascript setInterval timer to refresh a small 1x1 spacer image when session is about to expire conditionally or always w/o any performance hit.

The question is about how to communicate session expiration to the user, not how to prevent session expiry from a technical perspective.

notification logout
Rectangle 27 15

here is the simplest session code using php. We are using 3 files.

<?php  session_start(); ?>  // session starts with the help of this function 

<?php

if(isset($_SESSION['use']))   // Checking whether the session is already there or not if 
                              // true then header redirect it to the home page directly 
 {
    header("Location:home.php"); 
 }

if(isset($_POST['login']))   // it checks whether the user clicked login button or not 
{
     $user = $_POST['user'];
     $pass = $_POST['pass'];

      if($user == "Ank" && $pass == "1234")  // username is  set to "Ank"  and Password   
         {                                   // is 1234 by default     

          $_SESSION['use']=$user;


         echo '<script type="text/javascript"> window.open("home.php","_self");</script>';            //  On Successful Login redirects to home.php

        }

        else
        {
            echo "invalid UserName or Password";        
        }
}
 ?>
<html>
<head>

<title> Login Page   </title>

</head>

<body>

<form action="" method="post">

    <table width="200" border="0">
  <tr>
    <td>  UserName</td>
    <td> <input type="text" name="user" > </td>
  </tr>
  <tr>
    <td> PassWord  </td>
    <td><input type="password" name="pass"></td>
  </tr>
  <tr>
    <td> <input type="submit" name="login" value="LOGIN"></td>
    <td></td>
  </tr>
</table>
</form>

</body>
</html>
<?php   session_start();  ?>

<html>
  <head>
       <title> Home </title>
  </head>
  <body>
<?php
      if(!isset($_SESSION['use'])) // If session is not set then redirect to Login Page
       {
           header("Location:Login.php");  
       }

          echo $_SESSION['use'];

          echo "Login Success";

          echo "<a href='logout.php'> Logout</a> "; 
?>
</body>
</html>
<?php
 session_start();

  echo "Logout Successfully ";
  session_destroy();   // function that Destroys Session 
  header("Location: Login.php");
?>

Using sessions & session variables in a PHP Login Script - Stack Overf...

php session login
Rectangle 27 8

The current version of Session Buddy (v3.0.9) is coded in pure JavaScript, with the exception that it uses MooTools for internationalization of dates and ordinals (I'm currently exploring alternatives to that though, so this may be replaced in favor of a different library in a future release). The code obfuscation is achieved through a simple js parser I built using C#.

Addendum: I should add (because you mention the code structure) that I pass the code through Google's Closure Compiler with a compilation level of WHITESPACE_ONLY.

Hi Hans, I admire you a lot. I have not enough reputation point to vote up your answer, so I leave you a comment instead. Thanks for your great chrome extension, and also for your rapid answer. It's very useful for me.

Thank you. I appreciate the compliment. I wish I could have provided more information with respect to different frameworks/libraries that might facilitate your work, but I don't have enough experience with any of them to recommend one with any sense of authority. jQuery seems to be the prevailing general-purpose js library, so I'd start there if you haven't already. I will say this: while using something like jQuery to build Session Buddy would have surely expedited the effort, I feel like I learned a lot about js that I would have missed out on had I done so.

Framework to develop Google Chrome Extension "Session Buddy" - Stack O...

google-chrome frameworks
Rectangle 27 5

I typically store things like menu state or filter (set of inputs in a div) visibility, etc. server-side in the session via AJAX. When a menu expands or a filter is shown, the click handler will fire an AJAX event to a web service that will record the state of the menu or filter visibility in the user's session. On a postback I use the session variables corresponding to each menu/filter to set it's initial state via CSS. I find that this is better user experience since the page doesn't flash when it is updated by javascript after loading if you make the changes client-side.

Example -- as I'm on the road this not actual code from a project and may be incomplete. Uses jQuery. The Url for the web service is going to depend on how you implement web services. I'm using ASP.NET MVC (mostly) so mine would be a controller action.

<script type='text/javascript'>
    $(document).ready( function() {
       $('#searchFilter').click( function()  {
           var filter = $(this);
           var filterName = filter.attr('id');
           var nowVisible = filter.css('display') === 'none';
           if (nowVisible) {
              filter.show();
           }
           else {
              filter.hide();
           }
           $.post('/controller/SetFilterVisibility',
                  { name: filterName, visibility: nowVisible } );
       });
    });
</script>


<div id='searchFilter' <%= ViewData["searchFilterVisibility"] %> >
    ...
</div>
[AcceptVerbs( HttpVerbs.POST )]
[Authorization]
public ActionResult SetFilterVisibility( string name, bool visible )
{
    Session[name] = visible;
    return Content( string.Empty );  // not used... 
}

[AcceptVerbs( HttpVerbs.GET )]
[Authorization]
public ActionResult SomeAction( int id )
{
    ...
    ViewData["searchFilterVisibility"] = Session["searchFilter"];
    ...
    return View();
}

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

asp.net webforms and jquery: How to save/restore jquery state between ...

asp.net jquery user-interface webforms postback
Rectangle 27 3

If you can't use Javascript and don't want to spend server resources with Session variables, you can also serialize and deserialize the values being entered in the different steps, and pass it back and forth using a hidden input field. A bit like ViewState in ASP.NET Webforms.

The problem with this solution is the amount of data you end up storing in your hidden input field, which increases the size of both the HTTP request and its respective response. Both of these are going to affect the performance of your site for the user and other users as well (since it will affect your bandwidth). The latter may be negligible, depending on how often the wizard is being accessed, but it could cause a problem. If you are going to serialize the data, you are better to store it in a DB table temporarily or the session.

@charles, if you expect so huge traffic in the wizard, then the session object will overfill much faster than you will get performance issues with serializing/deserializing of the previous steps (or even bandwith issues) Solution above is definitely more scalable and safer(performance-wise). Remember that we are talking about asp.net mvc, so I'm 99% sure that the session is not distributed, or at least on the state server.. Beware of the microoptimalizations on the wrong place..

@jhexp, I have no idea how you can say that using a hidden input field is more scalable and safer for performance than using a temporary database table. There is absolutely no way you are going to get better performance passing a huge string back and forth on every request than you would get by pulling it out of the database each time. Oh, and as for session, why do you think that the session is not distributed? That's totally up to the implementer, MVC has no restriction on that.

@charles You want to tell us that full database query per each step is faster and more scalable than having a hidden field in the form?? And I don't say that MVC restricts implementation of distributed sessions, but its a very very rare case. Many highly loaded apps are stateless on the server anyway.

@jhexp you obviously have no idea how slow an HTTP request is in comparison to a simple database call. Adding to the size of that request and response is definitely slower than a single database call. And that's with a high-speed connection, don't even get started on dial up (yes, people still DO use dial up).

c# - how to make a wizard with ASP.Net MVC - Stack Overflow

c# .net asp.net-mvc wizard
Rectangle 27 3

If you can't use Javascript and don't want to spend server resources with Session variables, you can also serialize and deserialize the values being entered in the different steps, and pass it back and forth using a hidden input field. A bit like ViewState in ASP.NET Webforms.

The problem with this solution is the amount of data you end up storing in your hidden input field, which increases the size of both the HTTP request and its respective response. Both of these are going to affect the performance of your site for the user and other users as well (since it will affect your bandwidth). The latter may be negligible, depending on how often the wizard is being accessed, but it could cause a problem. If you are going to serialize the data, you are better to store it in a DB table temporarily or the session.

@charles, if you expect so huge traffic in the wizard, then the session object will overfill much faster than you will get performance issues with serializing/deserializing of the previous steps (or even bandwith issues) Solution above is definitely more scalable and safer(performance-wise). Remember that we are talking about asp.net mvc, so I'm 99% sure that the session is not distributed, or at least on the state server.. Beware of the microoptimalizations on the wrong place..

@jhexp, I have no idea how you can say that using a hidden input field is more scalable and safer for performance than using a temporary database table. There is absolutely no way you are going to get better performance passing a huge string back and forth on every request than you would get by pulling it out of the database each time. Oh, and as for session, why do you think that the session is not distributed? That's totally up to the implementer, MVC has no restriction on that.

@charles You want to tell us that full database query per each step is faster and more scalable than having a hidden field in the form?? And I don't say that MVC restricts implementation of distributed sessions, but its a very very rare case. Many highly loaded apps are stateless on the server anyway.

@jhexp you obviously have no idea how slow an HTTP request is in comparison to a simple database call. Adding to the size of that request and response is definitely slower than a single database call. And that's with a high-speed connection, don't even get started on dial up (yes, people still DO use dial up).

c# - how to make a wizard with ASP.Net MVC - Stack Overflow

c# .net asp.net-mvc wizard
Rectangle 27 1

Might be a long shot but are you using any framework or cms? I know that wordpress would delete session variables (http://blog.ginchen.de/en/2008/08/15/session-variablen-in-wordpress/) can you show the javascript code you're using to load viewUsers? Are you programming on a local server?

I'm using jQuery and not using a CMS. I have added the javascript code. Yes I'm programming on local server. I'm using xampp. Thank you for your help! :)

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

jquery - PHP Session ID the same but variables are lost - Stack Overfl...

php jquery session-variables sessionid