Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6841055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:55:10+00:00 2026-05-26T23:55:10+00:00

Good day, I have recently started playing with RingoJS along with Stick middleware and

  • 0

Good day,

I have recently started playing with RingoJS along with Stick middleware and I am now stuck with sessions. I can’t make it work.

main.js

var {Application} = require( "./_lib_/stick" ),
    app = exports.app = Application();

app.configure( "mount" );
app.mount( "/", require( "./actions" ) );

if ( require.main === module ) {
    require( "ringo/httpserver" ).main( module.directory );
}

actions.js

var {Application, helpers} = require( "./_lib_/stick" ),
    Response = require( "ringo/jsgi/response" );

export( "app" );

var app = Application();

app.configure( "route", "render", "session" );
app.render.base = module.resolve( "templates" );
app.render.master = "page.html";

app.get("/session.htm", function( request ) {
    //request.session.data.foo = "bar";
    request.session.data.put("foo", "bar");

    return Response.redirect( "session2.htm" );
});

app.get("/session2.htm", function( request ) {
    var value = request.session;

    return Response.html( "Session: " + value );
});

I’ve tested many combinaison but none of them worked as espected.

Most errors I get is about reading the data from the session. For example:

TypeError: Cannot read property “data” from undefined

Any tips?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:55:10+00:00Added an answer on May 26, 2026 at 11:55 pm

    "session" needs to come before "mount" in app.configure.

    On the fourth line of main.js:

    app.configure( "session", "mount" );
    

    Then, remove "session" from the later call to app.configure since there’s no point in running the middleware twice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day! I right now have a function the drags an element from a
Good day all, I have a preset situation that can't be changed, that revolves
Good day, I have searched far and wide but all I can find is
Good Day all, I have an existing site built. I was wondering, how can
Good Day. I have to make a C++ project Linux compatible. In the existing
Good Day! i have installed xcode latest in my snow leopard, now i have
Good day, I have this problem with Html.DropDownListFor which I can't seem to work
Good day. I have little usage of Flash CS4, however i have to build
Good day, If I have for example the documents which have the following fields
Good day, I have the following problem: class B extends class A and methods

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.