Authentication
Introduction
This chapter describes how to authenticate to E-BLOC using basic authentication or cookie-based sessions. All requests to E-BLOC services use the cookie retrieved after the initial authentication.
Note
Sessions typically expire after 24 hours. It is recommended to reuse valid cookies until expiration rather than performing repeated authentications.
Basic Authentication
The E-BLOC GUI uses an HTML form with the following fields:
Authentication Form
1<form action="index.php?profil=0" method="post" name="f">
2 <input name="pUser" id="pUser" type="text" placeholder="Username/Email">
3 <input name="pPass" id="pPass" type="password" placeholder="Password">
4 <input id="pConectare" type="submit" value="Conectare">
5</form>
Authentication Flow
The authentication process follows these steps:
Fill in the
pUserfield with username or emailFill in the
pPassfield with the passwordClick the
pConectare(Connect) buttonThe browser sends a POST request to E-BLOC
On success, the response contains the
PHPSESSIDvalueUse the
PHPSESSIDcookie for all subsequent requests
Obtaining Sessions
From Browser Developer Tools
To extract session cookies from an active browser session:
Log in to E-BLOC using your preferred browser
Open Developer Tools (usually F12 or right-click → Inspect)
Navigate to the Application tab
In the left sidebar, find Cookies under the Storage section
Click the E-BLOC URL to view its cookies
Find the
PHPSESSIDvalueCopy all relevant cookies for use in your application
From Basic Authentication Request
1import requests
2
3response = requests.post(
4 'https://www.e-bloc.ro/index.php?profil=0',
5 data={'pUser': 'your_email@example.com', 'pPass': 'your_password'},
6 allow_redirects=False
7)
8
9# Extract PHPSESSID from response cookies
10session_id = response.cookies.get('PHPSESSID')