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

  • SEARCH
  • Home
  • 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 8870689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:47:56+00:00 2026-06-14T17:47:56+00:00

I have an application with a base controller, base html and base javascript file.

  • 0

I have an application with a base controller, base html and base javascript file. In this three a create a token with unique client id (create_channel) and I pass the token to the template and create the connection in the javascript file.

Then I send a message to this connection. If I stay in the same page it works well and I see the message but if I go to other page the base.js is load again and new connection is started so I never see the message that I sent from the server.

Any idea how can I resolve this issue? I only want to create one connection but the base file is load more times…

  • 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-06-14T17:47:57+00:00Added an answer on June 14, 2026 at 5:47 pm

    Each “user” has to have an ID. I use the session ID. Then you create the token against that only if it does not already exist.

    channel_token = self.session.get('channel_token')
        if channel_token is None: # if the session user does not have a channel token
            user_id = str(uuid.uuid4()).replace("-",'')
            channel_token = channel.create_channel(user_id)
            self.session['channel_token'] = channel_token
            self.session['user_id'] = user_id
    

    So when you go to a different page you don’t create a new channel if one already is available for that user_Id. When the user navigates away you’ll get a disconnect/connect each time. And you can use the user_id to send the message regardless of what page they are on.

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

Sidebar

Related Questions

I have my application code base with multiple activities in it. I have a
We have developed map base application. We have implemented multi-threading for display data on
in my zf application i have base model class Application_Model, which connects to db
I have a production issue with In-Proc session state. Our application is base on
I have a code base that has been used as an ASP.Net web application.
I have a model in my rails application which is class Person < ActiveRecord::Base
I am creating an ASP.NET MVC3 application using NHIBERNATE. I have a base class
I have a base controller class that attempts to look at Request.ContentType to see
I have an application that allows users to create loads and bid on them.
I have an application that builds an HTML email. Included in the content is

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.