Started Session C1 Of User

 Posted admin
Started Session C1 Of User Average ratng: 7,0/10 5371 votes

My System is Fedora 23 x86_64 running Xfce4

When system installed , i did:

and remove something i don't like with:

and shutdown (i don't recall if there is the bug appeared) but when i installed mariadb (or mysql) and postgresql and other things and shutdown there is always

Forums say it's a systemd bug but on systemctl command:

For me it worked simply by removing sessionstart, if the session is already started then why do we need to start it again.In my case It was just a config.php file which INCLUDEd in code – Mangesh Sathe Jun 25 '18 at 12:28. A user-designated name for the business process that initiated the Sterling Connect:Direct Server Begin Session service. If not specified, the process name is generated dynamically.

shows following info:

I don't thing it's mariadb or postgresql problem .

When shutdown, it only shows

not saying what job.

How can i debug this nasty bug ?

What tools or information do i need?

BHS
4413 gold badges10 silver badges24 bronze badges
SeAL80sSeAL80s

1 Answer

It seems like a bug. It affect me too. First time I've seen this bug on Fedora 20 or 21. It was patched, but returned in 23. It's somehow related to systemd and it's not only on Fedora - I've seen posts about it ex. on Arch Linux forums.

You can share with this, describing problems in this bug on bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1088619 or https://bugzilla.redhat.com/show_bug.cgi?id=1272635

JosephJoseph
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Not the answer you're looking for? Browse other questions tagged shutdownsystemd or ask your own question.

I have a PHP file that is sometimes called from a page that has started a session and sometimes from a page that doesn't have session started. Therefore when I have session_start() on this script I sometimes get the error message for 'session already started'. For that I've put these lines:

but this time I got this warning message:

Notice: Undefined variable: _SESSION

Is there a better way to check if session has already started?

If I use @session_start will it make things work properly and just shut up the warnings?

random
8,3567 gold badges56 silver badges74 bronze badges
LoganLogan
5,1929 gold badges33 silver badges49 bronze badges

26 Answers

Recommended way for versions of PHP >= 5.4.0 , PHP 7

Reference: http://www.php.net/manual/en/function.session-status.php

For versions of PHP < 5.4.0

lovelyramoslovelyramos
7,1671 gold badge12 silver badges16 bronze badges

For versions of PHP prior to PHP 5.4.0:

Though, IMHO, you should really think about refactoring your session management code if you don't know whether or not a session is started..

That said, my opinion is subjective, and there are situations (examples of which are described in the comments below) where it may not be possible to know if the session is started.

AlexAlex
2,4963 gold badges15 silver badges41 bronze badges

PHP 5.4 introduced session_status(), which is more reliable than relying on session_id().

Consider the following snippet:

So, to check whether a session is started, the recommended way in PHP 5.4 is now:

BenjaminBenjamin
16.7k30 gold badges131 silver badges240 bronze badges

you can do this, and it's really easy.

Hope it helps :)

miyurumiyuru
k.bonk.bon

Prior to PHP 5.4 there is no reliable way of knowing other than setting a global flag.

Consider:

Or:

So, prior to PHP 5.4 you should set a global boolean.

Ryan YoosefiRyan Yoosefi
supersuphotsupersuphot

Started Session C1 Of User Root

ElshanElshan
4,0072 gold badges41 silver badges79 bronze badges
Started session c1 of user root

Use session_id(), it returns an empty string if not set. It's more reliable than checking the $_COOKIE.

Benjamin
16.7k30 gold badges131 silver badges240 bronze badges
Wesley van OpdorpWesley van Opdorp
13.2k4 gold badges36 silver badges57 bronze badges
Mahesh CheliyaMahesh Cheliya
5381 gold badge9 silver badges18 bronze badges

This should work for all PHP versions. It determines the PHP version, then checks to see if the session is started based on the PHP version. Then if the session is not started it starts it.

Dustin PoissantDustin Poissant
2,1621 gold badge13 silver badges18 bronze badges
user3140580user3140580

Not sure about efficiency of such solution, but this is from working projectThis is also used if you need to define the default language

Alex KhimichAlex Khimich

You should reorganize your code so that you call session_start() exactly once per page execution.

SamTSamT
8,4482 gold badges27 silver badges35 bronze badges

On PHP 5.3 this works for me:

then you have. If you do not put the not at if statement beginning the session will start any way I do not why.

Lucas M. OliveiraLucas M. Oliveira

Response BASED on @Meliza Ramos Response(see first response) and http://php.net/manual/en/function.phpversion.php ,

ACTIONS:

  • define PHP_VERSION_ID if not exist
  • define function to check version based on PHP_VERSION_ID
  • define function to openSession() secure

only use openSession()

Pretty much I can't do anything but linger here in startup repair land. This may be useful to read - 'Startup Repair' on Win7 - how long does it take? Recycling a movie from my harddrive is taking long long time. I then decided to use Windows Startup Repair, which after selecting, seemed. I left this screen on overnight, for about 7 hours, and the screen. Hello, I have a week old laptop, that for whatever reason decided to run Startup Repair (Win 7) I have not. Startup repair takes 15 to 45 minutes MAX! Hardware (failing HDD) So this ended not being a Windows problem. Mar 25, 2015 - a complete guide to fix Fix Windows Startup Repair Stuck in Loop and Taking Too Long Problem in windows 8 and windows 7. Fix #1: Boot into Safe Mode. Insert the disc and reboot the system. Press any key to boot from the DVD. Choose your keyboard layout. Click Repair your computer at the Install now screen. Click Troubleshoot. Click Advanced options. Click Startup Settings. Click Restart. Windows 7 startup repair takes how long.

user1817927

Actually, it is now too late to explain it here anyway as its been solved.This was a .inc file of one of my projects where you configure a menu for a restaurant by selecting a dish and remove/add or change the order.The server I was working at did not had the actual version so I made it more flexible. It's up to the authors wish to use and try it out.

ThieliciousThielicious
NiroshanNiroshan
Tunaki
94.8k23 gold badges216 silver badges298 bronze badges
Sukanya SukuSukanya Suku

PHP_VERSION_ID is available as of PHP 5.2.7, so check this first and if necessary , create it. session_status is available as of PHP 5.4 , so we have to check this too:

Christian KruseChristian Kruse

Based on my practice, before accessing the $_SESSION[] you need to call session_start every time to use the script. See the link below for manual.

For me at least session_start is confusing as a name. A session_load can be more clear.

Shree

Started Session C1 Of User Debian-gdm

13.6k20 gold badges77 silver badges125 bronze badges
Eduard HasanajEduard Hasanaj
Leo TahkLeo Tahk

You can use the following solution to check if a PHP session has already started:

Grant Miller
7,69613 gold badges41 silver badges65 bronze badges
Manjeet Kumar NaiManjeet Kumar Nai

This is what I use to determine if a session has started. By using empty and isset as follows:

Suit Boy Apps
1,5863 gold badges25 silver badges43 bronze badges
Akintunde-RotimiAkintunde-Rotimi
3,8363 gold badges11 silver badges23 bronze badges

@ before a function call suppresses any errors that may be reported during the function call.

Adding a @ before session_start tells PHP to avoid printing error messages.

Started Session C1 Of User Manual

For example:

Using session_start() after you've already printed something to the browser results in an error so PHP will display something like 'headers cannot be sent: started at (line 12)', @session_start() will still fail in this case, but the error message is not printed on screen.

Before including the files or redirecting to new page use the exit() function, otherwise it will give an error.

This code can be used in all cases:

crabbly
3,5011 gold badge12 silver badges29 bronze badges
sangram desaisangram desai
Nikolay Mihaylov
3,6158 gold badges21 silver badges31 bronze badges
Harshit ChaturvediHarshit Chaturvedi

Not the answer you're looking for? Browse other questions tagged phpsessionsession-variables or ask your own question.