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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:09:09+00:00 2026-06-10T15:09:09+00:00

I’m using gae-sessions . The client is an iOS application, and I want sessions

  • 0

I’m using gae-sessions. The client is an iOS application, and I want sessions to persist for the lifetime of the app (so the only way a session expires or is invalid is when the user logs out or the user deletes the app, other wise the session has no expiration date). I don’t think I want to use cookies, as cookies are short lived (or should I?)

So what I’m doing is creating a new session, get the automatically generated SID for that session (session id, a random string), and sending that string back to the client and saving it there for good. Now every time the user sends a request, the session id is also sent over, and I get the current session using this id:

# gets the session with given session id
session = gaesessions.Session(sid = session_id)

First, is anything wrong with this approach? Is there a better way to do this?

Now, when the user logs out, it’s easy to submit a request to invalidate the session with the given id. However, if the user deletes the app, I’ll have no way of ever getting that session and deleting it. So how would I clean up no longer valid sessions?

  • 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-10T15:09:11+00:00Added an answer on June 10, 2026 at 3:09 pm

    I’m wondering why you need a session at all. Just store the data in some per-user object in the datastore. Then it’s easy to refer to that user. I’m assuming you’re already storing some sort of user data other than the session.

    This answer doesn’t solve the problem though, you never know if a user deletes the app, so you’ll have that user data around forever. This is more of a policy question than a tech question.

    If you do want to delete the user data, you’ll need to set some sort of policy (ie, if you haven’t logged-in in 2 years, we’re deleting your account). In which case, your expire is essentially 2 years. You’ll need a cron job that runs periodically ane clean out expired Users (or session).

    Btw, gae-sessions includes example cleanup code for expired sessions, including a cron handler.

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.