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 9268319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:46:51+00:00 2026-06-18T14:46:51+00:00

this is my logout click event: logoutClicked: (event) -> event.preventDefault() console.log ‘userPanel.logoutClicked -> event’,

  • 0

this is my logout click event:

logoutClicked: (event) ->
  event.preventDefault()
  console.log 'userPanel.logoutClicked -> event', event
  console.info App.session
  App.session.destroy
    wait: true

    success: (model, res) ->
      console.log 'session.destroy.success -> model/res', model, res

    error: (model, res) ->
      console.log 'session.destroy.error -> model/res', model, res

this is my session model:

class App.Model.Session extends Backbone.Model

  initialize: ->
    console.log 'Session.init'

  urlRoot: '/session'

and this is my slim backend route:

$app->delete('/session', function () {
  session_unset();
  exit(true);
});

When i trigger the logoutClicked event all is working fine, but i can’t see any server communication (no DELETE or GET to /session…) through my firebug..

Firebug output:

userPanel.logoutClicked -> event Object { originalEvent=Event click, type="click", timeStamp=18807379, altri elementi...}
Session { cid="c1", attributes={...}, _changing=false, altri elementi...}
session.destroy.success -> model/res Session { cid="c1", attributes={...}, _changing=false, altri elementi...} null

as u can see no DELETE request fired… and i receive a null res from my session.destroy success callback…
I’m new on Backbone, any suggestion? Maybe i have to setup Backbone.sync?

  • 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-18T14:46:52+00:00Added an answer on June 18, 2026 at 2:46 pm

    If you call Model.destroy(…) on a new Model (which Model.isNew() === true). .destroy(…) won’t do anything.

    Reference:

    • Model.isNew() http://backbonejs.org/docs/backbone.html#section-67
    • Model.destroy() http://backbonejs.org/docs/backbone.html#section-63

    One way to “force” destroy to be called is to manually set Model’s ID to be not NULL, like…

    App.Session.set('id', '_session_id_');
    

    However, when you retrieve App.Session, its ID should already be set to the session ID. In that case, when retrieving a session from the server, you may want to do this step manually.


    Side Note

    If you want to call your ID attribute as sessionID instead of just id, you can also override the default idAttribute on Backbone.Model.

    App.Session.Model
      idAttribute: 'sessionId'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple GAE app that includes a login/logout link. This app is
I used this, <a title=Logout onclick=javascript:document.getElementById('ctl00_ContentPlaceHolder1_LbLogout').click(); href=# class=logout>Logout</a></li> <asp:LinkButton ID=LbLogout runat=server style=display:none onclick=LbLogout_Click>Sign out</asp:LinkButton>
I have the following code $(#logoutLink).click(function(event) { event.preventDefault(); var dataString = action=confirm; $.ajax({ type:
Our app uses Facebook app API and as of this morning, our log out
My URLconf contains this pattern: url(r'^accounts/logout/$','django.contrib.auth.views.logout', name=logout), And I've trying to reverse that in
Started with this question: OpenID. How do you logout OK. So OpenID does not
I have this urls on urls.py url(r'^login/$', 'django.contrib.auth.views.login', {'template_name':'login.html'}), url(r'^(one|two)/logout/$', 'django.contrib.auth.views.logout_then_login', {'login_url':'/login/'}) I'm trying
I have a button like this: <Button android:id=@+id/logout_button android:layout_width=fill_parent android:layout_height=wrap_content android:text=Log out /> and
How do I make a logout using Facebook's api log me out of my
I am trying to clear activities history stack, when user click on logout button

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.