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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:31:45+00:00 2026-06-12T12:31:45+00:00

since PHP can’t be used in Spotify apps directly I am using it on

  • 0

since PHP can’t be used in Spotify apps directly I am using it on my server only, but I am having problems getting the sessions to work, is it possible to use sessions even?

I want to use it to see if a user is registered in my database or not so I am doing it like this:

session_start();

$query="SELECT * FROM user WHERE facebookID = {$fbid}";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
$num_results = mysql_num_rows($result);
if ($num_results > 0)
{
echo"THERE IS A USER!";
$row['facebookID'] = $_SESSION[fid];
}
else
{
 echo"THERE IS NO USER!";
}

the authentication to the server works fine but the session does not seem to be working, on another PHP page witch is being called after the above code has been called with some ajax code I simply wanted to try this:

session_start();

if(isset($_SESSION['fid']))
{
echo"SESSION EXIST";
}
else
{
echo"NO SESSION";
}

anyways is there a special way to do this in Spotify apps or do I have to do this in some other way?

  • 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-12T12:31:46+00:00Added an answer on June 12, 2026 at 12:31 pm

    Where do you set $_SESSION[fid] to be the FacebookID?

    Maybe you should do this:

    session_start();
    
    $query="SELECT * FROM user WHERE facebookID = {$fbid}";
    $result = mysql_query($query) or die(mysql_error());
    $row = mysql_fetch_array($result);
    if ($row)
    {
        echo "THERE IS A USER!";
        $_SESSION['fid'] = $row['facebookID']; // SET THE FACEBOOK ID IN THE SESSION
    } else {
        echo"THERE IS NO USER!";
    }
    

    BTW always put quotes around the key names when you access arrays in PHP, like this: $_SESSION['fid'] not $_SESSION[fid], otherwise PHP will first check for constant named “fid” then cast to string – its slower and more important – uglier and bad practice.

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

Sidebar

Related Questions

As far as I know, only PHP can't be used for this. But since
Using PHP how can I accurately test that a remote website supports the If-Modified-Since
It's been a while since I've installed PHP for Windows, but every guide I've
This kind of code would normally work in PHP, but since the scope is
I am currently translating my PHP application using gettext with POEdit. Since I respect
I have realized that my first question won't be answerable, since php can't deal
In PHP (since 5.2.0) I can write this code: //$t is timestamp of day
Since PHP is a loosely typed language, how can the DIP principle be applied
Since PHP has no custom-class type-casting, how would I go about doing the PHP
Since my AS3 and Php/Java knowledge is not good I got stuck on this

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.