---
title: newSession
description: "SparkSession.newSession method in PySpark: Returns a new SparkSession as a new session, that has separate SQL configuration, registered temporary views, and UDFs, but shares the SparkContext and table cache."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/sparksession/newSession
---

# newSession

Returns a new `SparkSession` as a new session, that has separate SQL configuration, registered temporary views, and UDFs, but shares the `SparkContext` and table cache.

## Syntax

```
newSession()
```

## Returns

`SparkSession`

## Examples

```python
spark.newSession()
```
