Is it acceptable to write that you are getting a "Ph.D. in [area]" (rather than name of department) on social media?
I believe it makes sense.
The PhD education is a very narrow education which will give you very specific knowledge regarding a specific aspect of a research area.
Therefore, it makes completely sense to be a bit more specific rather than general. PhD in computer science sounds very broad and not much descriptive.