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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:41:42+00:00 2026-06-07T02:41:42+00:00

I have to submit the User Session ID through an Post Request (using Flash

  • 0

I have to submit the User Session ID through an Post Request (using Flash Uploader).
Project is based on Zend Framework.

Now iam not sure if my implementation is “safe”:

View

var session = "<?= Anon_SimpleCrypt::encrypt(Zend_Session::getId(), 'SOME_KEY'?>";

Controller:

   $sessionId = $_POST['SESSION_ID'];
   $sessionId = Anon_SimpleCrypt::decrypt($sessionId, 'SOME_KEY'); 
   Zend_Session::setId($sessionId);

Encryption/Decryption:

    public static function encrypt($value, $encryptionKey) 
    {
        $result = '';
        $encryptionKey = $encryptionKey . self::getSalt($value);

        for ($count = 0; $count < strlen($value); $count++) {
            $char = substr($value, $count, 1);
            $keychar = substr($encryptionKey, ($count % strlen($encryptionKey)) - 1, 1);
            $char = chr(ord($char) + ord($keychar));
            $result.=$char;
        }

        return base64_encode($result);
    }

    public static function decrypt($value, $encryptionKey) 
    {
        $result = '';
        $value = base64_decode($value);

        $encryptionKey = $encryptionKey . self::getSalt($value);

        for ($i = 0; $i < strlen($value); $i++) {
            $char = substr($value, $i, 1);
            $keychar = substr($encryptionKey, ($i % strlen($encryptionKey)) - 1, 1);
            $char = chr(ord($char) - ord($keychar));
            $result.=$char;
        }

        return $result;
    }
  • 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-07T02:41:46+00:00Added an answer on June 7, 2026 at 2:41 am

    You do not need to encrypt the session id. Just send it in plain text. The session id is usually stored unencrypted in a cookie on the client, and this is no different. Besides, if someone get the encrypted session id they will still be able to use the session because you decrypt it on the server anyway.

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

Sidebar

Related Questions

I have a submit button that changes when the user hovers his mouse over
I have a form, when user submit the form, I want to direct the
I have an android app which let the user to submit a form ,
I currently have a wysiwyg iframe where the user can submit input to another
I have an HTML page with a simple form. When the user clicks submit,
I have a form whereby a user fills it in and clicks submit. This
I have a page where a user submits an order, and after they submit
I want to have multiple multiple choices given to user after the form submit
I want my user to be able to hit the submit button and have
I have a form, and a submit handler in jQuery. When the user submits

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.