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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:06:36+00:00 2026-06-04T13:06:36+00:00

I have this code in the login.php file : //save user data $token=$user->getId().’_’.hash(‘sha256′,$user->getUsername().microtime()); $name=’fsusr_’.$user->getUsername();

  • 0

I have this code in the login.php file :

 //save user data 
  $token=$user->getId().'_'.hash('sha256',$user->getUsername().microtime());
  $name='fsusr_'.$user->getUsername();

  //set session and server variables
  $_SESSION[$name]=$token;   //set session variable
  $_SERVER[$name]=$token;    //set server variable

and in the page_init.php , just after login process, I want to retrieve the server and session variables so that I can compare them , and decide what to do next:

I have this on line 8 :

 echo $_SERVER[$name];

In fact , the problem is that the other page sends me this error in this very line:

Undefined index: fsusr_smoootk in … on line 8.

When I make an print_r($_SERVER) in login.php , I see the array containing the $_SERVER[$name] variable… But when doing the same in the other page, I see that it no more contains that variable.

I know that it did not save the server variable to the other page, But I don’t know why?

thanks in advance

  • 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-04T13:06:37+00:00Added an answer on June 4, 2026 at 1:06 pm

    The $_SERVER variable is meant for server information. You should assign your own variables into $_SESSION.

    http://us.php.net/manual/en/reserved.variables.server.php

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

Sidebar

Related Questions

I have this horribly stripped delphi code that basically login to server, save cookie
Hello guys I have this code in main.php config file: 'components' => array( '[.........]',
i tried this code to hide the php file extension i have this url
I have written php script for user login but instead of displaying the result
here is my JS code: $.ajax({ url: 'login.php', type: 'POST', data: { loginName: $(#loginName).val(),
I have a (HTTPS) login.php page which remains HTTPS (ie once user logged in
I have this code header(location:login_success.php); The frame target code that I used in html
I have a single php file to handle login/logout on my site. The login
I have an issue about writing HTML file with PHP. I have this function
All i want is, a data will pass into this php file: check.php 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.