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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:48:58+00:00 2026-05-27T23:48:58+00:00

I know nothing about PHP, but in my application I need to implement user

  • 0

I know nothing about PHP, but in my application I need to implement user login and logout. I’ve found this nice tutorial and have successfully implemented logging in, but how do I log out? I just can’t find any information about it in google, particularly about iPhone side. PHP tutorials mostly explain a lot of theory about sessions and stuff like that which is not applicable for my specific event. I would love to spend my time for learning that theory, but I have to learn PHP basics first and this is not what I currently need.

All I need is to understand the correct way of implementing logout.

  1. I would be glad very much if someone explained me shortly in plain language the mechanism of standard interaction between iPhone app and php script when logging in and out.
  2. This is more important. Would you please provide me with few lines of php and objective- с code displaying how to implement logging out?
  • 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-27T23:48:59+00:00Added an answer on May 27, 2026 at 11:48 pm

    In our app we use this schema:

    Login I’ll jumpover (that you’ve done)

    When the user logout our application call an URL, which is considered for logout. For example: http://ourcoresyste.com/logout.php

    Sorry for inconvinience, but I’m not iOS developer, so I don’t know exactly how application makes call, but I think you should know it, if login is done.

    In the script logout.php:

    <?php
        if (!isset($_SESSION))
        {
            exit(json_encode(array('code' => 0, 'message' => 'Logout successful')));
        }
        esle
        {
            $user = $_SESSION['user_id']; // suppose you have stored into $_SESSION['user_id'] logged in user;
            // Do some stuff while logout, maybe some DB interactions.
            if ($shit_happens)
            {
                exit(json_encode(array('code' => 1, 'message' => 'Shit happens')));
            }
            unset($_SESSION['user_id']); // or session_destroy(), if you want completly remove all information about user.
            exit(json_encode(array('code' => 0, 'message' => 'Logout successful')));
        }
    

    Than in your app you parse JSON response which will be like this:

    {"code":0,"message":"Your detailed message"}
    

    And decide by code retrieved from JSON response, were user logged out or not. If he was, next time you call any PHP script, which relies on $_SESSION[‘user_id’], will fail, probably that’s mean that user is logged out.

    I think that’s all.

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

Sidebar

Related Questions

know nothing about php, but I have this script that reads a folder and
i know nothing about ruby but a lot about php. when you code in
I am building a free WP theme but know next to nothing about PHP.
I'm an experienced programmer (PHP/mySQL, jQuery), but know nothing about ColdFusion. A precursory Google
i know nothing about medical records but im sure there's great opportunity in it
I know almost nothing about linq. I'm doing this: var apps = from app
I know almost nothing about cryptography, but I would like to figure out how
Here is my situation: I know almost nothing about Perl, but it is the
Well, I know absolutely nothing about the subject, so I really need help. I
I am a beginner in PHP and I know nothing about XML manipulation. I

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.